|
| 1 | +// RUN: %target-swift-emit-module-interface(%t.swiftinterface) %s -module-name exclusivity |
| 2 | +// RUN: %target-swift-typecheck-module-from-interface(%t.swiftinterface) -module-name exclusivity |
| 3 | +// RUN: %FileCheck %s < %t.swiftinterface |
| 4 | + |
| 5 | +// CHECK: @exclusivity(checked) public var checkedGlobalVar: Swift.Int |
| 6 | +@exclusivity(checked) |
| 7 | +public var checkedGlobalVar = 1 |
| 8 | + |
| 9 | +// CHECK: @exclusivity(unchecked) public var uncheckedGlobalVar: Swift.Int |
| 10 | +@exclusivity(unchecked) |
| 11 | +public var uncheckedGlobalVar = 1 |
| 12 | + |
| 13 | +// CHECK-LABEL: public struct Struct |
| 14 | +public struct Struct { |
| 15 | + // CHECK: @exclusivity(unchecked) public static var uncheckedStaticVar: Swift.Int |
| 16 | + @exclusivity(unchecked) |
| 17 | + public static var uncheckedStaticVar: Int = 27 |
| 18 | + |
| 19 | + // CHECK: @exclusivity(checked) public static var checkedStaticVar: Swift.Int |
| 20 | + @exclusivity(checked) |
| 21 | + public static var checkedStaticVar: Int = 27 |
| 22 | +} |
| 23 | + |
| 24 | +// CHECK-LABEL: public class Class |
| 25 | +public class Class { |
| 26 | + // CHECK: @exclusivity(unchecked) public var uncheckedInstanceVar: Swift.Int |
| 27 | + @exclusivity(unchecked) |
| 28 | + public var uncheckedInstanceVar: Int = 27 |
| 29 | + |
| 30 | + // CHECK: @exclusivity(checked) public var checkedInstanceVar: Swift.Int |
| 31 | + @exclusivity(checked) |
| 32 | + public var checkedInstanceVar: Int = 27 |
| 33 | + |
| 34 | + // CHECK: @exclusivity(unchecked) public var uncheckedPrivateSetInstanceVar: Swift.Int { |
| 35 | + // CHECK-NEXT: get |
| 36 | + // CHECK-NEXT: } |
| 37 | + @exclusivity(unchecked) |
| 38 | + public private(set) var uncheckedPrivateSetInstanceVar: Int = 27 |
| 39 | + |
| 40 | + // CHECK: @exclusivity(unchecked) public static var uncheckedStaticVar: Swift.Int |
| 41 | + @exclusivity(unchecked) |
| 42 | + public static var uncheckedStaticVar: Int = 27 |
| 43 | +} |
0 commit comments