|
| 1 | +// RUN: %empty-directory(%t) |
| 2 | + |
| 3 | +// RUN: %target-swift-frontend -typecheck -module-name Test -emit-parseable-module-interface-path %t/Test.swiftinterface %s |
| 4 | +// RUN: %FileCheck %s < %t/Test.swiftinterface --check-prefix CHECK --check-prefix NONRESILIENT |
| 5 | +// RUN: %target-swift-frontend -build-module-from-parseable-interface %t/Test.swiftinterface -o %t/Test.swiftmodule |
| 6 | +// RUN: %target-swift-frontend -emit-module -o /dev/null -merge-modules -emit-parseable-module-interface-path - %t/Test.swiftmodule -module-name Test | %FileCheck %s --check-prefix CHECK --check-prefix NONRESILIENT |
| 7 | + |
| 8 | +// RUN: %target-swift-frontend -typecheck -module-name TestResilient -emit-parseable-module-interface-path %t/TestResilient.swiftinterface -enable-resilience %s |
| 9 | +// RUN: %FileCheck %s < %t/TestResilient.swiftinterface --check-prefix CHECK --check-prefix RESILIENT |
| 10 | + |
| 11 | +// RUN: %target-swift-frontend -build-module-from-parseable-interface %t/TestResilient.swiftinterface -o %t/TestResilient.swiftmodule |
| 12 | +// RUN: %target-swift-frontend -emit-module -o /dev/null -merge-modules -emit-parseable-module-interface-path - %t/TestResilient.swiftmodule -module-name TestResilient | %FileCheck %s --check-prefix CHECK --check-prefix RESILIENT |
| 13 | + |
| 14 | +// CHECK: @_fixed_layout public struct HasLazyVarsFixedLayout { |
| 15 | +// CHECK-NEXT: public var foo: [[INT:(Swift\.)?Int]] { |
| 16 | +// CHECK-NEXT: mutating get |
| 17 | +// CHECK-NEXT: set |
| 18 | +// CHECK-NEXT: } |
| 19 | +// CHECK: private var $__lazy_storage_$_foo: [[INT]]? |
| 20 | +// CHECK-NOT: private var bar |
| 21 | +// CHECK: private var $__lazy_storage_$_bar: [[INT]]? |
| 22 | +// CHECK-NEXT: } |
| 23 | +@_fixed_layout |
| 24 | +public struct HasLazyVarsFixedLayout { |
| 25 | + public lazy var foo: Int = 0 |
| 26 | + private lazy var bar: Int = 0 |
| 27 | +} |
| 28 | + |
| 29 | +// CHECK: public struct HasLazyVars { |
| 30 | +// CHECK-NEXT: public var foo: [[INT:(Swift\.)?Int]] { |
| 31 | +// CHECK-NEXT: mutating get |
| 32 | +// CHECK-NEXT: set |
| 33 | +// CHECK-NEXT: } |
| 34 | +// NONRESILIENT: private var $__lazy_storage_$_foo: [[INT]]? |
| 35 | +// CHECK-NOT: private var bar |
| 36 | +// NONRESILIENT: private var $__lazy_storage_$_bar: [[INT]]? |
| 37 | +// CHECK-NEXT: } |
| 38 | +public struct HasLazyVars { |
| 39 | + public lazy var foo: Int = 0 |
| 40 | + private lazy var bar: Int = 0 |
| 41 | +} |
0 commit comments