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.
36 lines
1.0 KiB
Swift
36 lines
1.0 KiB
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple -emit-module-path %t/a.swiftmodule -module-name a %s
|
|
// RUN: llvm-bcanalyzer -dump %t/a.swiftmodule | %FileCheck --check-prefix BC-CHECK --implicit-check-not UnknownCode %s
|
|
// RUN: %target-swift-ide-test -print-module -module-to-print a -source-filename x -I %t | %FileCheck --check-prefix MODULE-CHECK %s
|
|
|
|
// REQUIRES: concurrency
|
|
|
|
///////////
|
|
// This test checks for correct serialization & deserialization of
|
|
// nonisolated
|
|
|
|
// look for correct annotation after first deserialization's module print:
|
|
|
|
// MODULE-CHECK: actor UnsafeCounter {
|
|
// MODULE-CHECK-NEXT: var storage: Int
|
|
// MODULE-CHECK-NEXT: nonisolated var count: Int
|
|
// MODULE-CHECK-NEXT: deinit
|
|
// MODULE-CHECK-NEXT: init()
|
|
// MODULE-CHECK-NEXT: }
|
|
|
|
// and look for nonisolated
|
|
|
|
// BC-CHECK: <Nonisolated_DECL_ATTR abbrevid={{[0-9]+}} op0=0 op1=0/>
|
|
|
|
|
|
actor UnsafeCounter {
|
|
|
|
private var storage : Int = 0
|
|
|
|
nonisolated
|
|
var count : Int {
|
|
get { 0 }
|
|
set { }
|
|
}
|
|
}
|