|
| 1 | +// RUN: %empty-directory(%t) |
| 2 | + |
| 3 | +// RUN: %target-swift-emit-module-interface(%t/Test.swiftinterface) %s -module-name Test -target %target-cpu-apple-macos51 |
| 4 | +// RUN: %target-swift-typecheck-module-from-interface(%t/Test.swiftinterface) -module-name Test |
| 5 | +// RUN: %FileCheck %s < %t/Test.swiftinterface |
| 6 | + |
| 7 | +// RUN: %target-swift-emit-module-interface(%t/TestMinInlining.swiftinterface) %s -module-name Test -target %target-cpu-apple-macos51 -target-min-inlining-version min |
| 8 | +// RUN: %target-swift-typecheck-module-from-interface(%t/TestMinInlining.swiftinterface) -module-name Test |
| 9 | +// RUN: %FileCheck %s < %t/TestMinInlining.swiftinterface |
| 10 | + |
| 11 | +// REQUIRES: OS=macosx |
| 12 | + |
| 13 | +// CHECK-LABEL: public struct StructWithProperties |
| 14 | +public struct StructWithProperties { |
| 15 | + // CHECK: @available(macOS, unavailable) |
| 16 | + // CHECK-NEXT: public var unavailableComputed: Swift.Int { |
| 17 | + // CHECK-NEXT: get |
| 18 | + // CHECK-NEXT: } |
| 19 | + @available(macOS, unavailable) |
| 20 | + public var unavailableComputed: Int { 1 } |
| 21 | + |
| 22 | + // CHECK: @available(macOS 51, *) |
| 23 | + // CHECK-NEXT: public let introducedAtDeploymentStored: Swift.Int |
| 24 | + @available(macOS 51, *) |
| 25 | + public let introducedAtDeploymentStored: Int = 1 |
| 26 | + |
| 27 | + // CHECK: @available(macOS 99, *) |
| 28 | + // CHECK-NEXT: public var introducedAfterDeploymentComputed: Swift.Int { |
| 29 | + // CHECK-NEXT: get |
| 30 | + // CHECK-NEXT: } |
| 31 | + @available(macOS 99, *) |
| 32 | + public var introducedAfterDeploymentComputed: Int { 1 } |
| 33 | + |
| 34 | + // CHECK: @available(macOS, unavailable) |
| 35 | + // CHECK-NEXT: public let introducedAtDeploymentSPIStored: Swift.Int |
| 36 | + @_spi_available(macOS 51, *) |
| 37 | + public let introducedAtDeploymentSPIStored: Int = 1 |
| 38 | +} |
| 39 | + |
| 40 | +// CHECK-LABEL: public enum EnumWithAssociatedValues |
| 41 | +public enum EnumWithAssociatedValues { |
| 42 | + // CHECK: @available(macOS, unavailable) |
| 43 | + // CHECK-NEXT: case unavailable |
| 44 | + @available(macOS, unavailable) |
| 45 | + case unavailable |
| 46 | + |
| 47 | + // CHECK: @available(macOS 51, *) |
| 48 | + // CHECK-NEXT: case introducedAtDeployment |
| 49 | + @available(macOS 51, *) |
| 50 | + case introducedAtDeployment |
| 51 | + |
| 52 | + // CHECK: @available(macOS 99, *) |
| 53 | + // CHECK-NEXT: case introducedAfterDeployment |
| 54 | + @available(macOS 99, *) |
| 55 | + case introducedAfterDeployment |
| 56 | + |
| 57 | + // CHECK: @available(macOS, unavailable) |
| 58 | + // CHECK-NEXT: case unavailableWithAssoc(Swift.Int) |
| 59 | + @available(macOS, unavailable) |
| 60 | + case unavailableWithAssoc(Int) |
| 61 | + |
| 62 | + // CHECK: @available(macOS 51, *) |
| 63 | + // CHECK-NEXT: case introducedAtDeploymentWithAssoc(Swift.Int) |
| 64 | + @available(macOS 51, *) |
| 65 | + case introducedAtDeploymentWithAssoc(Int) |
| 66 | +} |
0 commit comments