Skip to content

Commit aa4a6d9

Browse files
committed
tests: get a few additional SILGen tests passing on Windows
These emit SIL in the correct order currently, just need some adjustment for Windows. Improves test coverage on Windows. Splintered from PR21371.
1 parent a9c1ea0 commit aa4a6d9

6 files changed

+33
-25
lines changed

test/SILGen/collection_upcast.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11

2-
// RUN: %target-swift-emit-silgen -module-name collection_upcast -sdk %S/Inputs -I %S/Inputs -enable-source-import %s | %FileCheck %s
2+
// RUN: %target-swift-emit-silgen -module-name collection_upcast -sdk %S/Inputs -I %S/Inputs -enable-source-import %s -enable-objc-interop -disable-objc-attr-requires-foundation-module | %FileCheck %s
33

44
// FIXME: rdar://problem/19648117 Needs splitting objc parts out
5-
// XFAIL: linux
65

76
import Foundation
87

test/SILGen/enum_raw_representable_objc.swift

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,28 @@
11
// RUN: %target-swift-emit-silgen -emit-sorted-sil -enable-objc-interop -disable-objc-attr-requires-foundation-module %s | %FileCheck %s
22
// RUN: %target-swift-emit-silgen -emit-sorted-sil -enable-objc-interop -disable-objc-attr-requires-foundation-module -enable-resilience %s | %FileCheck -check-prefix=CHECK-RESILIENT %s
33

4+
#if os(Windows) && arch(x86_64)
5+
@objc public enum CLike: Int32 {
6+
case a, b, c
7+
}
8+
#else
49
@objc public enum CLike: Int {
510
case a, b, c
611
}
12+
#endif
713

8-
// CHECK-LABEL: sil [serialized] [ossa] @$s27enum_raw_representable_objc5CLikeO0B5ValueACSgSi_tcfC
14+
// CHECK-LABEL: sil [serialized] [ossa] @$s27enum_raw_representable_objc5CLikeO0B5ValueACSg{{Si|s5Int32V}}_tcfC
915

10-
// CHECK-LABEL: sil [serialized] [ossa] @$s27enum_raw_representable_objc5CLikeO0B5ValueSivg
16+
// CHECK-LABEL: sil [serialized] [ossa] @$s27enum_raw_representable_objc5CLikeO0B5Value{{Si|s5Int32V}}vg
1117
// CHECK-DAG: [[RESULT_BOX:%.+]] = alloc_stack $Int
1218
// CHECK-DAG: [[INPUT_BOX:%.+]] = alloc_stack $CLike
13-
// CHECK: [[RAW_TYPE:%.+]] = metatype $@thick Int.Type
19+
// CHECK: [[RAW_TYPE:%.+]] = metatype $@thick Int{{(32)?}}.Type
1420
// CHECK: [[CAST_FUNC:%.+]] = function_ref @$ss13unsafeBitCast_2toq_x_q_mtr0_lF
15-
// CHECK: = apply [[CAST_FUNC]]<CLike, Int>([[RESULT_BOX]], [[INPUT_BOX]], [[RAW_TYPE]])
21+
// CHECK: = apply [[CAST_FUNC]]<CLike, Int{{(32)?}}>([[RESULT_BOX]], [[INPUT_BOX]], [[RAW_TYPE]])
1622
// CHECK: [[RESULT:%.+]] = load [trivial] [[RESULT_BOX]]
1723
// CHECK: return [[RESULT]]
18-
// CHECK: end sil function '$s27enum_raw_representable_objc5CLikeO0B5ValueSivg'
24+
// CHECK: end sil function '$s27enum_raw_representable_objc5CLikeO0B5Value{{Si|s5Int32V}}vg'
25+
26+
// CHECK-RESILIENT-DAG: sil [ossa] @$s27enum_raw_representable_objc5CLikeO0B5Value{{Si|s5Int32V}}vg
27+
// CHECK-RESILIENT-DAG: sil [ossa] @$s27enum_raw_representable_objc5CLikeO0B5ValueACSg{{Si|s5Int32V}}_tcfC
1928

20-
// CHECK-RESILIENT-DAG: sil [ossa] @$s27enum_raw_representable_objc5CLikeO0B5ValueSivg
21-
// CHECK-RESILIENT-DAG: sil [ossa] @$s27enum_raw_representable_objc5CLikeO0B5ValueACSgSi_tcfC

test/SILGen/imported_struct_array_field.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-emit-silgen -import-objc-header %S/Inputs/array_typedef.h %s | %FileCheck %s
1+
// RUN: %target-swift-emit-silgen -enable-objc-interop -disable-objc-attr-requires-foundation-module -import-objc-header %S/Inputs/array_typedef.h %s | %FileCheck %s
22

33
// CHECK-LABEL: sil shared [transparent] [serializable] [ossa] @$sSo4NameV{{[_0-9a-zA-Z]*}}fC : $@convention(method) (UInt8, UInt8, UInt8, UInt8, @thin Name.Type) -> Name
44
func useImportedArrayTypedefInit() -> Name {

test/SILGen/lying_about_optional_return.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-emit-silgen -import-objc-header %S/Inputs/c_function_pointer_in_c_struct.h %s | %FileCheck %s
1+
// RUN: %target-swift-emit-silgen -enable-objc-interop -disable-objc-attr-requires-foundation-module -import-objc-header %S/Inputs/c_function_pointer_in_c_struct.h %s | %FileCheck %s
22

33
// CHECK-LABEL: sil hidden [ossa] @$s27lying_about_optional_return0C37ChainingForeignFunctionTypeProperties{{[_0-9a-zA-Z]*}}F
44
func optionalChainingForeignFunctionTypeProperties(a: SomeCallbacks?) {

test/SILGen/pointer_conversion.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

2-
// RUN: %target-swift-emit-silgen -module-name pointer_conversion -sdk %S/Inputs -I %S/Inputs -enable-source-import %s | %FileCheck %s
2+
// RUN: %target-swift-emit-silgen -module-name pointer_conversion -sdk %S/Inputs -I %S/Inputs -enable-source-import %s -enable-objc-interop | %FileCheck %s
33

44
// FIXME: rdar://problem/19648117 Needs splitting objc parts out
5-
// XFAIL: linux
5+
// REQUIRES: objc_interop
66

77
import Foundation
88

test/SILGen/witness_tables_serialized.swift

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,17 @@ public struct PublicResilientStruct : PublicProtocol, InternalProtocol {}
1616
@usableFromInline
1717
internal struct InternalStruct : PublicProtocol, InternalProtocol {}
1818

19-
// CHECK: sil_witness_table [serialized] PublicStruct: PublicProtocol
20-
// CHECK: sil_witness_table [serialized] PublicStruct: InternalProtocol
21-
22-
// CHECK-NONRESILIENT: sil_witness_table [serialized] PublicResilientStruct: PublicProtocol
23-
// CHECK-NONRESILIENT: sil_witness_table [serialized] PublicResilientStruct: InternalProtocol
24-
// CHECK-RESILIENT: sil_witness_table PublicResilientStruct: PublicProtocol
25-
// CHECK-RESILIENT: sil_witness_table PublicResilientStruct: InternalProtocol
26-
27-
// CHECK-NONRESILIENT: sil_witness_table [serialized] InternalStruct: PublicProtocol
28-
// CHECK-NONRESILIENT: sil_witness_table [serialized] InternalStruct: InternalProtocol
29-
// CHECK-RESILIENT: sil_witness_table InternalStruct: PublicProtocol
30-
// CHECK-RESILIENT: sil_witness_table InternalStruct: InternalProtocol
19+
// CHECK-DAG: sil_witness_table [serialized] PublicStruct: PublicProtocol
20+
// CHECK-DAG: sil_witness_table [serialized] PublicStruct: InternalProtocol
21+
22+
// CHECK-RESILIENT-DAG: sil_witness_table InternalStruct: InternalProtocol
23+
// CHECK-RESILIENT-DAG: sil_witness_table InternalStruct: PublicProtocol
24+
25+
// CHECK-RESILIENT-DAG: sil_witness_table PublicResilientStruct: PublicProtocol
26+
// CHECK-RESILIENT-DAG: sil_witness_table PublicResilientStruct: InternalProtocol
27+
28+
// CHECK-NONRESILIENT-DAG: sil_witness_table [serialized] InternalStruct: InternalProtocol
29+
// CHECK-NONRESILIENT-DAG: sil_witness_table [serialized] InternalStruct: PublicProtocol
30+
31+
// CHECK-NONRESILIENT-DAG: sil_witness_table [serialized] PublicResilientStruct: PublicProtocol
32+
// CHECK-NONRESILIENT-DAG: sil_witness_table [serialized] PublicResilientStruct: InternalProtocol

0 commit comments

Comments
 (0)