mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Use the `%target-swift-5.1-abi-triple` substitution to compile the tests for deployment to the minimum OS versions required for use of _Concurrency APIs, instead of disabling availability checking.
30 lines
657 B
Swift
30 lines
657 B
Swift
// RUN: %target-typecheck-verify-swift -target %target-swift-5.1-abi-triple
|
|
|
|
// REQUIRES: concurrency
|
|
|
|
func asyncGlobal1() async { }
|
|
func asyncGlobal2() async throws { }
|
|
|
|
typealias AsyncFunc1 = () async -> ()
|
|
typealias AsyncFunc2 = () async throws -> ()
|
|
typealias AsyncFunc3 = (_ a: Bool, _ b: Bool) async throws -> ()
|
|
|
|
func testTypeExprs() {
|
|
let _ = [() async -> ()]()
|
|
let _ = [() async throws -> ()]()
|
|
}
|
|
|
|
func testAwaitOperator() async {
|
|
let _ = await asyncGlobal1()
|
|
}
|
|
|
|
func testAsyncClosure() {
|
|
let _ = { () async in 5 }
|
|
let _ = { () throws in 5 }
|
|
let _ = { () async throws in 5 }
|
|
}
|
|
|
|
func testAwait() async {
|
|
let _ = await asyncGlobal1()
|
|
}
|