Skip to content

Commit 49b19f5

Browse files
authored
Merge pull request #24833 from slavapestov/cross-platform-stable-abi-tests
Run stable ABI tests on all Apple platforms
2 parents 64ce7b9 + 5d66bb8 commit 49b19f5

11 files changed

+134
-61
lines changed

test/IRGen/class_update_callback_without_fixed_layout.sil

Lines changed: 47 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-swift-frontend -emit-module -enable-library-evolution -emit-module-path=%t/resilient_struct.swiftmodule -module-name=resilient_struct %S/../Inputs/resilient_struct.swift
33

4-
// RUN: %target-swift-frontend -I %t -emit-ir -enable-library-evolution %s -target x86_64-apple-macosx10.14.3 | %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-OLD -DINT=i%target-ptrsize
5-
// RUN: %target-swift-frontend -I %t -emit-ir -enable-library-evolution %s -target x86_64-apple-macosx10.14.4 | %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-NEW -DINT=i%target-ptrsize
6-
// RUN: %target-swift-frontend -I %t -emit-ir -enable-library-evolution -O %s -target x86_64-apple-macosx10.14.3
7-
// RUN: %target-swift-frontend -I %t -emit-ir -enable-library-evolution -O %s -target x86_64-apple-macosx10.14.4
4+
// RUN: %target-swift-frontend -I %t -emit-ir -enable-library-evolution %s -target %target-pre-stable-abi-triple | %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-OLD --check-prefix=CHECK-%target-ptrsize --check-prefix=CHECK-OLD-%target-ptrsize -DINT=i%target-ptrsize
5+
// RUN: %target-swift-frontend -I %t -emit-ir -enable-library-evolution -O %s -target %target-pre-stable-abi-triple
86

97
// REQUIRES: objc_interop
10-
// REQUIRES: OS=macosx
11-
// REQUIRES: CPU=x86_64
128

139
// With the old deployment target, these classes use the 'singleton' metadata
1410
// initialization pattern. The class is not statically visible to Objective-C,
@@ -19,6 +15,9 @@
1915
// initialization pattern. These class *are* visible to Objective-C, and the
2016
// Swift runtime realizes them using the new _objc_realizeClassFromSwift()
2117
// entry point.
18+
//
19+
// See class_update_callback_without_fixed_layout_stable_abi.swift, which uses
20+
// the same input file, for the stable ABI deployment target test.
2221

2322
sil_stage canonical
2423

@@ -44,9 +43,10 @@ sil_vtable SubclassOfClassWithResilientField {}
4443

4544

4645
// Field offsets are not statically known:
47-
// CHECK-DAG: @"$s42class_update_callback_without_fixed_layout23ClassWithResilientFieldC5firstSivpWvd" = hidden constant i64 16, align 8
48-
// CHECK-DAG: @"$s42class_update_callback_without_fixed_layout23ClassWithResilientFieldC6second16resilient_struct4SizeVvpWvd" = hidden global i64 0, align 8
49-
// CHECK-DAG: @"$s42class_update_callback_without_fixed_layout23ClassWithResilientFieldC5thirdSivpWvd" = hidden global i64 0, align 8
46+
// CHECK-32-DAG: @"$s42class_update_callback_without_fixed_layout23ClassWithResilientFieldC5firstSivpWvd" = hidden constant i32 8
47+
// CHECK-64-DAG: @"$s42class_update_callback_without_fixed_layout23ClassWithResilientFieldC5firstSivpWvd" = hidden constant i64 16
48+
// CHECK-DAG: @"$s42class_update_callback_without_fixed_layout23ClassWithResilientFieldC6second16resilient_struct4SizeVvpWvd" = hidden global [[INT]] 0
49+
// CHECK-DAG: @"$s42class_update_callback_without_fixed_layout23ClassWithResilientFieldC5thirdSivpWvd" = hidden global [[INT]] 0
5050

5151

5252
// RO-data for ClassWithResilientField:
@@ -61,7 +61,7 @@ sil_vtable SubclassOfClassWithResilientField {}
6161
// -- the update callback
6262
// CHECK-NEW-SAME: @"$s42class_update_callback_without_fixed_layout23ClassWithResilientFieldCMU"
6363

64-
// CHECK-SAME: }, section "__DATA, __objc_const", align 8
64+
// CHECK-SAME: }, section "__DATA, __objc_const"
6565

6666
// Class has static metadata:
6767
// CHECK-LABEL: @"$s42class_update_callback_without_fixed_layout23ClassWithResilientFieldCMf"
@@ -94,10 +94,6 @@ public class ClassWithResilientEnum {
9494

9595
sil_vtable ClassWithResilientEnum {}
9696

97-
// Field offsets are not statically known:
98-
// CHECK-LABEL: @"$s42class_update_callback_without_fixed_layout22ClassWithResilientEnumC5firstAA0jhI7PayloadOvpWvd" = hidden global i64 0, align 8
99-
// CHECK-LABEL: @"$s42class_update_callback_without_fixed_layout22ClassWithResilientEnumC6seconds4Int8VvpWvd" = hidden global i64 0, align 8
100-
10197

10298
// Make sure extra inhabitants work when reading a legacy layout -- the
10399
// Optional<ResilientRef> should be 8 bytes in size, not 9
@@ -109,8 +105,8 @@ public class ClassWithResilientRef {
109105
sil_vtable ClassWithResilientRef {}
110106

111107
// Field offsets are not statically known:
112-
// CHECK-LABEL: @"$s42class_update_callback_without_fixed_layout21ClassWithResilientRefC5first16resilient_struct0iJ0VSgvpWvd" = hidden global i64 0, align 8
113-
// CHECK-LABEL: @"$s42class_update_callback_without_fixed_layout21ClassWithResilientRefC6secondSivpWvd" = hidden global i64 0, align 8
108+
// CHECK-DAG: @"$s42class_update_callback_without_fixed_layout21ClassWithResilientRefC5first16resilient_struct0iJ0VSgvpWvd" = hidden global [[INT]] 0
109+
// CHECK-DAG: @"$s42class_update_callback_without_fixed_layout21ClassWithResilientRefC6secondSivpWvd" = hidden global [[INT]] 0
114110

115111

116112
// When allocating a class with resiliently-sized fields, we must still load
@@ -121,36 +117,42 @@ sil_vtable ClassWithResilientRef {}
121117
sil @allocClassWithResilientField : $@convention(thin) () -> () {
122118
bb0:
123119

124-
// CHECK: [[T0:%.*]] = call swiftcc %swift.metadata_response @"$s42class_update_callback_without_fixed_layout23ClassWithResilientFieldCMa"(i64 0)
120+
// CHECK: [[T0:%.*]] = call swiftcc %swift.metadata_response @"$s42class_update_callback_without_fixed_layout23ClassWithResilientFieldCMa"([[INT]] 0)
125121
// CHECK-NEXT: [[META:%.*]] = extractvalue %swift.metadata_response [[T0]], 0
126122
// CHECK-NEXT: [[META_ADDR:%.*]] = bitcast %swift.type* [[META]] to i8*
127-
// CHECK-NEXT: [[SIZE_ADDR:%.*]] = getelementptr inbounds i8, i8* [[META_ADDR]], i32 48
123+
// CHECK-32-NEXT: [[SIZE_ADDR:%.*]] = getelementptr inbounds i8, i8* [[META_ADDR]], i32 28
124+
// CHECK-64-NEXT: [[SIZE_ADDR:%.*]] = getelementptr inbounds i8, i8* [[META_ADDR]], i32 48
128125
// CHECK-NEXT: [[SIZE_PTR:%.*]] = bitcast i8* [[SIZE_ADDR]] to i32*
129-
// CHECK-NEXT: [[SIZE_2:%.*]] = load i32, i32* [[SIZE_PTR]], align 8
130-
// CHECK-NEXT: [[SIZE:%.*]] = zext i32 [[SIZE_2]] to i64
131-
// CHECK-NEXT: [[ALIGN_ADDR:%.*]] = getelementptr inbounds i8, i8* [[META_ADDR]], i32 52
126+
// CHECK-32-NEXT: [[SIZE:%.*]] = load i32, i32* [[SIZE_PTR]]
127+
// CHECK-64-NEXT: [[SIZE_2:%.*]] = load i32, i32* [[SIZE_PTR]]
128+
// CHECK-64-NEXT: [[SIZE:%.*]] = zext i32 [[SIZE_2]] to i64
129+
// CHECK-32-NEXT: [[ALIGN_ADDR:%.*]] = getelementptr inbounds i8, i8* [[META_ADDR]], i32 32
130+
// CHECK-64-NEXT: [[ALIGN_ADDR:%.*]] = getelementptr inbounds i8, i8* [[META_ADDR]], i32 52
132131
// CHECK-NEXT: [[ALIGN_PTR:%.*]] = bitcast i8* [[ALIGN_ADDR]] to i16*
133-
// CHECK-NEXT: [[ALIGN_2:%.*]] = load i16, i16* [[ALIGN_PTR]], align 4
134-
// CHECK-NEXT: [[ALIGN:%.*]] = zext i16 [[ALIGN_2]] to i64
135-
// CHECK-NEXT: [[ALLOC:%.*]] = call noalias %swift.refcounted* @swift_allocObject(%swift.type* [[META]], i64 [[SIZE]], i64 [[ALIGN]])
132+
// CHECK-NEXT: [[ALIGN_2:%.*]] = load i16, i16* [[ALIGN_PTR]]
133+
// CHECK-NEXT: [[ALIGN:%.*]] = zext i16 [[ALIGN_2]] to [[INT]]
134+
// CHECK-NEXT: [[ALLOC:%.*]] = call noalias %swift.refcounted* @swift_allocObject(%swift.type* [[META]], [[INT]] [[SIZE]], [[INT]] [[ALIGN]])
136135
%c = alloc_ref $ClassWithResilientField
137136

138137
// ... dealloc_ref also does the same thing.
139138

140139
// CHECK-NEXT: [[SELF:%.*]] = bitcast %swift.refcounted* [[ALLOC]] to %T42class_update_callback_without_fixed_layout23ClassWithResilientFieldC*
141140
// CHECK-NEXT: [[ISA_ADDR:%.*]] = getelementptr inbounds %T42class_update_callback_without_fixed_layout23ClassWithResilientFieldC, %T42class_update_callback_without_fixed_layout23ClassWithResilientFieldC* [[SELF]], i32 0, i32 0, i32 0
142-
// CHECK-NEXT: [[META:%.*]] = load %swift.type*, %swift.type** [[ISA_ADDR]], align 8
141+
// CHECK-NEXT: [[META:%.*]] = load %swift.type*, %swift.type** [[ISA_ADDR]]
143142
// CHECK-NEXT: [[META_ADDR:%.*]] = bitcast %swift.type* [[META]] to i8*
144-
// CHECK-NEXT: [[SIZE_ADDR:%.*]] = getelementptr inbounds i8, i8* [[META_ADDR]], i32 48
143+
// CHECK-32-NEXT: [[SIZE_ADDR:%.*]] = getelementptr inbounds i8, i8* [[META_ADDR]], i32 28
144+
// CHECK-64-NEXT: [[SIZE_ADDR:%.*]] = getelementptr inbounds i8, i8* [[META_ADDR]], i32 48
145145
// CHECK-NEXT: [[SIZE_PTR:%.*]] = bitcast i8* [[SIZE_ADDR]] to i32*
146-
// CHECK-NEXT: [[SIZE_2:%.*]] = load i32, i32* [[SIZE_PTR]], align 8
147-
// CHECK-NEXT: [[SIZE:%.*]] = zext i32 [[SIZE_2]] to i64
148-
// CHECK-NEXT: [[ALIGN_ADDR:%.*]] = getelementptr inbounds i8, i8* [[META_ADDR]], i32 52
146+
// CHECK-32-NEXT: [[SIZE:%.*]] = load i32, i32* [[SIZE_PTR]]
147+
// CHECK-64-NEXT: [[SIZE_2:%.*]] = load i32, i32* [[SIZE_PTR]]
148+
// CHECK-64-NEXT: [[SIZE:%.*]] = zext i32 [[SIZE_2]] to i64
149+
// CHECK-32-NEXT: [[ALIGN_ADDR:%.*]] = getelementptr inbounds i8, i8* [[META_ADDR]], i32 32
150+
// CHECK-64-NEXT: [[ALIGN_ADDR:%.*]] = getelementptr inbounds i8, i8* [[META_ADDR]], i32 52
149151
// CHECK-NEXT: [[ALIGN_PTR:%.*]] = bitcast i8* [[ALIGN_ADDR]] to i16*
150-
// CHECK-NEXT: [[ALIGN_2:%.*]] = load i16, i16* [[ALIGN_PTR]], align 4
151-
// CHECK-NEXT: [[ALIGN:%.*]] = zext i16 [[ALIGN_2]] to i64
152+
// CHECK-NEXT: [[ALIGN_2:%.*]] = load i16, i16* [[ALIGN_PTR]]
153+
// CHECK-NEXT: [[ALIGN:%.*]] = zext i16 [[ALIGN_2]] to [[INT]]
152154
// CHECK-NEXT: [[ALLOC:%.*]] = bitcast %T42class_update_callback_without_fixed_layout23ClassWithResilientFieldC* [[SELF]] to %swift.refcounted*
153-
// CHECK-NEXT: call void @swift_deallocClassInstance(%swift.refcounted* [[ALLOC]], i64 [[SIZE]], i64 [[ALIGN]])
155+
// CHECK-NEXT: call void @swift_deallocClassInstance(%swift.refcounted* [[ALLOC]], [[INT]] [[SIZE]], [[INT]] [[ALIGN]])
154156
dealloc_ref %c : $ClassWithResilientField
155157

156158
%result = tuple ()
@@ -183,22 +185,23 @@ bb0:
183185
// Accessing a field whose offset depends on resilient types should
184186
// use the field offset global.
185187

186-
// CHECK-LABEL: define swiftcc {{(dllexport )?}}{{(protected )?}}i64 @accessClassWithResilientField(%T42class_update_callback_without_fixed_layout23ClassWithResilientFieldC*)
188+
// CHECK-32-LABEL: define swiftcc {{(dllexport )?}}{{(protected )?}}i32 @accessClassWithResilientField(%T42class_update_callback_without_fixed_layout23ClassWithResilientFieldC*)
189+
// CHECK-64-LABEL: define swiftcc {{(dllexport )?}}{{(protected )?}}i64 @accessClassWithResilientField(%T42class_update_callback_without_fixed_layout23ClassWithResilientFieldC*)
187190
sil @accessClassWithResilientField : $@convention(thin) (@guaranteed ClassWithResilientField) -> Int {
188191
bb0(%0 : $ClassWithResilientField):
189192

190-
// CHECK: [[OFFSET:%.*]] = load i64, i64* @"$s42class_update_callback_without_fixed_layout23ClassWithResilientFieldC5thirdSivpWvd", align 8
193+
// CHECK: [[OFFSET:%.*]] = load [[INT]], [[INT]]* @"$s42class_update_callback_without_fixed_layout23ClassWithResilientFieldC5thirdSivpWvd"
191194
// CHECK-NEXT: [[SELF_ADDR:%.*]] = bitcast %T42class_update_callback_without_fixed_layout23ClassWithResilientFieldC* %0 to i8*
192-
// CHECK-NEXT: [[FIELD_ADDR:%.*]] = getelementptr inbounds i8, i8* [[SELF_ADDR]], i64 [[OFFSET]]
195+
// CHECK-NEXT: [[FIELD_ADDR:%.*]] = getelementptr inbounds i8, i8* [[SELF_ADDR]], [[INT]] [[OFFSET]]
193196
// CHECK-NEXT: [[FIELD_PTR2:%.*]] = bitcast i8* [[FIELD_ADDR]] to %TSi*
194197
// CHECK-NEXT: [[FIELD_PTR:%.*]] = getelementptr inbounds %TSi, %TSi* [[FIELD_PTR2]], i32 0, i32 0
195198

196199
%1 = ref_element_addr %0 : $ClassWithResilientField, #ClassWithResilientField.third
197200

198-
// CHECK-NEXT: [[VALUE:%.*]] = load i64, i64* [[FIELD_PTR]], align 8
201+
// CHECK-NEXT: [[VALUE:%.*]] = load [[INT]], [[INT]]* [[FIELD_PTR]]
199202
%2 = load %1 : $*Int
200203

201-
// CHECK-NEXT: ret i64 [[VALUE]]
204+
// CHECK-NEXT: ret [[INT]] [[VALUE]]
202205
return %2 : $Int
203206
}
204207

@@ -209,7 +212,7 @@ bb0(%0 : $ClassWithResilientField):
209212

210213
// CHECK-NEW-LABEL: define internal %objc_class* @"$s42class_update_callback_without_fixed_layout23ClassWithResilientFieldCMU"(%objc_class*, i8*)
211214
// CHECK-NEW: entry:
212-
// CHECK-NEW-NEXT: [[RESPONSE:%.*]] = call swiftcc %swift.metadata_response @"$s42class_update_callback_without_fixed_layout23ClassWithResilientFieldCMa"(i64 0)
215+
// CHECK-NEW-NEXT: [[RESPONSE:%.*]] = call swiftcc %swift.metadata_response @"$s42class_update_callback_without_fixed_layout23ClassWithResilientFieldCMa"([[INT]] 0)
213216
// CHECK-NEW-NEXT: [[METADATA:%.*]] = extractvalue %swift.metadata_response [[RESPONSE]], 0
214217
// CHECK-NEW-NEXT: [[RESULT:%.*]] = bitcast %swift.type* [[METADATA]] to %objc_class*
215218
// CHECK-NEW-NEXT: ret %objc_class* [[RESULT]]
@@ -223,9 +226,11 @@ bb0(%0 : $ClassWithResilientField):
223226
// CHECK: entry:
224227
// CHECK-NEXT: [[FIELDS:%.*]] = alloca [3 x i8**]
225228
// CHECK-NEXT: [[METADATA_ADDR:%.*]] = bitcast %swift.type* %0 to [[INT]]*
226-
// CHECK-NEXT: [[FIELDS_DEST:%.*]] = getelementptr inbounds [[INT]], [[INT]]* [[METADATA_ADDR]], [[INT]] {{10|13}}
229+
// CHECK-32-NEXT: [[FIELDS_DEST:%.*]] = getelementptr inbounds [[INT]], [[INT]]* [[METADATA_ADDR]], [[INT]] 13
230+
// CHECK-64-NEXT: [[FIELDS_DEST:%.*]] = getelementptr inbounds [[INT]], [[INT]]* [[METADATA_ADDR]], [[INT]] 10
227231
// CHECK-NEXT: [[FIELDS_ADDR:%.*]] = bitcast [3 x i8**]* [[FIELDS]] to i8*
228-
// CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 {{12|24}}, i8* [[FIELDS_ADDR]])
232+
// CHECK-32-NEXT: call void @llvm.lifetime.start.p0i8(i64 12, i8* [[FIELDS_ADDR]])
233+
// CHECK-64-NEXT: call void @llvm.lifetime.start.p0i8(i64 24, i8* [[FIELDS_ADDR]])
229234
// CHECK-NEXT: [[FIELDS_PTR:%.*]] = getelementptr inbounds [3 x i8**], [3 x i8**]* [[FIELDS]], i32 0, i32 0
230235

231236
// CHECK: [[T0:%.*]] = call swiftcc %swift.metadata_response @"$s16resilient_struct4SizeVMa"([[INT]] 319)
@@ -270,7 +275,8 @@ bb0(%0 : $ClassWithResilientField):
270275
// CHECK: entry:
271276
// CHECK-NEXT: [[FIELDS:%.*]] = alloca [0 x i8**]
272277
// CHECK-NEXT: [[METADATA_ADDR:%.*]] = bitcast %swift.type* %0 to [[INT]]*
273-
// CHECK-NEXT: [[FIELDS_DEST:%.*]] = getelementptr inbounds [[INT]], [[INT]]* [[METADATA_ADDR]], [[INT]] {{11|14}}
278+
// CHECK-32-NEXT: [[FIELDS_DEST:%.*]] = getelementptr inbounds [[INT]], [[INT]]* [[METADATA_ADDR]], [[INT]] 17
279+
// CHECK-64-NEXT: [[FIELDS_DEST:%.*]] = getelementptr inbounds [[INT]], [[INT]]* [[METADATA_ADDR]], [[INT]] 14
274280
// CHECK-NEXT: [[FIELDS_ADDR:%.*]] = bitcast [0 x i8**]* [[FIELDS]] to i8*
275281
// CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 0, i8* [[FIELDS_ADDR]])
276282
// CHECK-NEXT: [[FIELDS_PTR:%.*]] = getelementptr inbounds [0 x i8**], [0 x i8**]* [[FIELDS]], i32 0, i32 0
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: %target-swift-frontend -emit-module -enable-library-evolution -emit-module-path=%t/resilient_struct.swiftmodule -module-name=resilient_struct %S/../Inputs/resilient_struct.swift
3+
4+
// RUN: %target-swift-frontend -I %t -emit-ir -enable-library-evolution %S/class_update_callback_without_fixed_layout.sil -target %target-stable-abi-triple | %FileCheck %S/class_update_callback_without_fixed_layout.sil --check-prefix=CHECK --check-prefix=CHECK-NEW --check-prefix=CHECK-%target-ptrsize --check-prefix=CHECK-NEW-%target-ptrsize -DINT=i%target-ptrsize
5+
// RUN: %target-swift-frontend -I %t -emit-ir -enable-library-evolution -O %S/class_update_callback_without_fixed_layout.sil -target %target-stable-abi-triple
6+
7+
// REQUIRES: objc_interop
8+
// REQUIRES: swift_stable_abi
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: %build-irgen-test-overlays
3+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) %S/eager-class-initialization.swift -target %target-stable-abi-triple -emit-ir | %FileCheck %S/eager-class-initialization.swift -DINT=i%target-ptrsize --check-prefix=CHECK
4+
5+
// REQUIRES: objc_interop
6+
// REQUIRES: swift_stable_abi

test/IRGen/eager-class-initialization.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %build-irgen-test-overlays
3-
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) %s -emit-ir | %FileCheck %s -DINT=i%target-ptrsize --check-prefix=CHECK --check-prefix=CHECK-OLD
4-
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) %s -target x86_64-apple-macosx10.14.4 -emit-ir | %FileCheck %s -DINT=i%target-ptrsize --check-prefix=CHECK
5-
// REQUIRES: CPU=x86_64
6-
// REQUIRES: OS=macosx
3+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) %s -emit-ir -target %target-pre-stable-abi-triple | %FileCheck %s -DINT=i%target-ptrsize --check-prefix=CHECK --check-prefix=CHECK-OLD
4+
5+
// REQUIRES: objc_interop
6+
7+
// See also eager-class-initialization-stable-abi.swift, for the stable ABI
8+
// deployment target test.
79

810
import Foundation
911

test/Interpreter/SDK/archive_attributes.swift

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@
33
// RUN: %target-run %t/encode %t/test.arc
44
// RUN: plutil -p %t/test.arc | %FileCheck -check-prefix=CHECK-ARCHIVE %s
55

6-
// RUN: %target-build-swift %s -module-name=test -o %t/decode
6+
// RUN: %target-build-swift %s -module-name=test -o %t/decode -target %target-pre-stable-abi-triple
77
// RUN: %target-run %t/decode %t/test.arc --stdlib-unittest-in-process
88

9-
// RUN: %target-build-swift %s -module-name=test -o %t/decode -target x86_64-apple-macosx10.14.4 -link-objc-runtime
10-
// RUN: %target-run %t/decode %t/test.arc NEW --stdlib-unittest-in-process
11-
129
// REQUIRES: executable_test
1310
// REQUIRES: objc_interop
14-
// REQUIRES: OS=macosx
11+
12+
// See also archive_attributes_stable_abi.swift, for the stable ABI
13+
// deployment target test.
1514

1615
import Foundation
1716
import StdlibUnittest
@@ -158,7 +157,7 @@ DecodeTestSuite.test("Decode") {
158157
}
159158

160159
if CommandLine.arguments[2] == "NEW" {
161-
if #available(macOS 10.14.4, *) {
160+
if #available(macOS 10.14.4, iOS 12.2, tvOS 12.2, watchOS 5.2, *) {
162161
doIt()
163162
}
164163
return
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: %target-build-swift %S/archive_attributes.swift -module-name=test -DENCODE -o %t/encode
3+
// RUN: %target-run %t/encode %t/test.arc
4+
// RUN: plutil -p %t/test.arc | %FileCheck -check-prefix=CHECK-ARCHIVE %S/archive_attributes.swift
5+
6+
// RUN: %target-build-swift %S/archive_attributes.swift -module-name=test -o %t/decode -target %target-stable-abi-triple -link-objc-runtime
7+
// RUN: %target-run %t/decode %t/test.arc NEW --stdlib-unittest-in-process
8+
9+
// REQUIRES: executable_test
10+
// REQUIRES: objc_interop
11+
// REQUIRES: swift_stable_abi

test/decl/protocol/conforms/nscoding.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -parse-as-library -swift-version 4 %s -verify
44
// RUN: not %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -parse-as-library -swift-version 4 %s -disable-nskeyedarchiver-diagnostics 2>&1 | %FileCheck -check-prefix CHECK-NO-DIAGS %s
55

6-
// RUN: not %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -parse-as-library -swift-version 4 %s -dump-ast -target x86_64-apple-macosx10.14.3 > %t/old.ast
7-
// RUN: not %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -parse-as-library -swift-version 4 %s -dump-ast -target x86_64-apple-macosx10.14.4 > %t/new.ast
6+
// RUN: not %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -parse-as-library -swift-version 4 %s -dump-ast -target %target-pre-stable-abi-triple > %t/old.ast
7+
// RUN: not %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -parse-as-library -swift-version 4 %s -dump-ast -target %target-stable-abi-triple > %t/new.ast
88

99
// RUN: %FileCheck --check-prefix=CHECK-OLD %s < %t/old.ast
1010
// RUN: %FileCheck --check-prefix=NEGATIVE %s < %t/old.ast
1111
// RUN: %FileCheck --check-prefix=NEGATIVE --check-prefix=NEGATIVE-NEW %s < %t/new.ast
1212

13-
// REQUIRES: OS=macosx
13+
// REQUIRES: objc_interop
1414

1515
// CHECK-NO-DIAGS-NOT: NSCoding
1616
// CHECK-NO-DIAGS-NOT: unstable

0 commit comments

Comments
 (0)