Skip to content

Commit d7f9e04

Browse files
committed
test: address portability concerns for Windows
Update the IRGen tests for Windows IRGen. This is an improvement over what we have currently, but is not sufficient to get all the IRGen tests passing yet.
1 parent f348fb1 commit d7f9e04

15 files changed

+31
-31
lines changed

test/IRGen/autolink-coff-force-link.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import swiftMSVCRT
1616

17-
// CHECK: @"_swift_FORCE_LOAD_$_swiftMSVCRT_$_autolink" = weak hidden constant void ()* @"_swift_FORCE_LOAD_$_swiftMSVCRT"
17+
// CHECK: @"_swift_FORCE_LOAD_$_swiftMSVCRT_$_autolink" = weak_odr hidden constant void ()* @"_swift_FORCE_LOAD_$_swiftMSVCRT"
1818
// CHECK: define dllexport void @"_swift_FORCE_LOAD_$_autolink"()
1919

2020
// CHECK-ASM-GNU: .ascii " -export:__swift_FORCE_LOAD_$_autolink"

test/IRGen/c_functions.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-swift-frontend -import-objc-header %S/Inputs/c_functions.h -primary-file %s -emit-ir | %FileCheck %s -check-prefix CHECK -check-prefix %target-cpu
2+
// RUN: %target-swift-frontend -enable-objc-interop -disable-objc-attr-requires-foundation-module -import-objc-header %S/Inputs/c_functions.h -primary-file %s -emit-ir | %FileCheck %s -check-prefix CHECK -check-prefix %target-cpu
33

44
// This is deliberately not a SIL test so that we can test SILGen too.
55

66
// CHECK-LABEL: define hidden swiftcc void @"$s11c_functions14testOverloadedyyF"
77
func testOverloaded() {
8-
// CHECK: call void @{{_Z10overloadedv|"\\01\?overloaded@@\$\$J0YAXXZ"}}()
8+
// CHECK: call void @{{_Z10overloadedv|"\?overloaded@@\$\$J0YAXXZ"}}()
99
overloaded()
10-
// CHECK: call void @{{_Z10overloadedi|"\\01\?overloaded@@\$\$J0YAXH@Z"}}(i32{{( signext)?}} 42)
10+
// CHECK: call void @{{_Z10overloadedi|"\?overloaded@@\$\$J0YAXH@Z"}}(i32{{( signext)?}} 42)
1111
overloaded(42)
1212
// CHECK: call void @{{.*}}test_my_log
1313
test_my_log()

test/IRGen/class.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ sil_vtable C {}
3434

3535
// CHECK: @"$s5class1CCMf" = internal global <{ {{.*}} }> <{
3636
// \ CHECK: void ([[C_CLASS]]*)* @"$s5class1CCfD",
37-
// \ CHECK: i8** @"$sBoWV",
37+
// \ CHECK: i8** {{@"\$sBoWV"|null}},
3838
// \ CHECK: i64 ptrtoint ([[OBJCCLASS]]* @"$s5class1CCMm" to i64),
3939
// \ CHECK: [[OBJCCLASS]]* @"OBJC_CLASS_$_{{(_TtCs12_)?}}SwiftObject",
4040
// \ CHECK: [[OPAQUE]]* @_objc_empty_cache,

test/IRGen/class_resilience.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
// CHECK: @"$s16class_resilience14ResilientChildCMo" = {{(protected )?}}{{(dllexport )?}}global [[BOUNDS]] zeroinitializer
3232

33-
// CHECK: @"$s15resilient_class22ResilientOutsideParentC8getValueSiyFTq" = external global %swift.method_descriptor
33+
// CHECK: @"$s15resilient_class22ResilientOutsideParentC8getValueSiyFTq" = external{{( dllimport)?}} global %swift.method_descriptor
3434

3535
// CHECK: @"$s16class_resilience14ResilientChildCMn" = {{(protected )?}}{{(dllexport )?}}constant <{{.*}}> <{
3636
// -- flags: class, unique, has vtable, has override table, in-place initialization, has resilient superclass
@@ -54,7 +54,7 @@
5454
// -- field offset vector offset:
5555
// CHECK-SAME: i32 0,
5656
// -- superclass:
57-
// CHECK-SAME: @"got.$s15resilient_class22ResilientOutsideParentCMn"
57+
// CHECK-SAME: @"{{got.|__imp_}}$s15resilient_class22ResilientOutsideParentCMn"
5858
// -- singleton metadata initialization cache:
5959
// CHECK-SAME: @"$s16class_resilience14ResilientChildCMl"
6060
// -- resilient pattern:
@@ -65,17 +65,17 @@
6565
// CHECK-SAME: i32 2,
6666
// CHECK-SAME: %swift.method_override_descriptor {
6767
// -- base class:
68-
// CHECK-SAME: @"got.$s15resilient_class22ResilientOutsideParentCMn"
68+
// CHECK-SAME: @"{{got.|__imp_}}$s15resilient_class22ResilientOutsideParentCMn"
6969
// -- base method:
70-
// CHECK-SAME: @"got.$s15resilient_class22ResilientOutsideParentC8getValueSiyFTq"
70+
// CHECK-SAME: @"{{got.|__imp_}}$s15resilient_class22ResilientOutsideParentC8getValueSiyFTq"
7171
// -- implementation:
7272
// CHECK-SAME: @"$s16class_resilience14ResilientChildC8getValueSiyF"
7373
// CHECK-SAME: }
7474
// CHECK-SAME: %swift.method_override_descriptor {
7575
// -- base class:
76-
// CHECK-SAME: @"got.$s15resilient_class22ResilientOutsideParentCMn"
76+
// CHECK-SAME: @"{{got.|__imp_}}$s15resilient_class22ResilientOutsideParentCMn"
7777
// -- base method:
78-
// CHECK-SAME: @"got.$s15resilient_class22ResilientOutsideParentCACycfCTq"
78+
// CHECK-SAME: @"{{got.|__imp_}}$s15resilient_class22ResilientOutsideParentCACycfCTq"
7979
// -- implementation:
8080
// CHECK-SAME: @"$s16class_resilience14ResilientChildCACycfC"
8181
// CHECK-SAME: }

test/IRGen/dead_method.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class Class {
3737
// CHECK-SAME: void (%T11dead_method5ClassC*)* @"$s11dead_method5ClassCfD",
3838

3939
// -- value witness table
40-
// CHECK-SAME: i8** @"$sBoWV",
40+
// CHECK-SAME: i8** {{@"\$sBoWV"|null}},
4141

4242
// -- nominal type descriptor
4343
// CHECK-SAME: @"$s11dead_method5ClassCMn",

test/IRGen/generic_vtable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class Concrete : Derived<Int> {
4141
// -- destructor
4242
// CHECK-SAME: void (%T14generic_vtable4BaseC*)* @"$s14generic_vtable4BaseCfD"
4343
// -- value witness table
44-
// CHECK-SAME: i8** @"$sBoWV"
44+
// CHECK-SAME: i8** {{@"\$sBoWV"|null}}
4545
// -- vtable entry for 'm1()'
4646
// CHECK-SAME: void (%T14generic_vtable4BaseC*)* @"$s14generic_vtable4BaseC2m1yyF"
4747
// -- vtable entry for 'm2()'

test/IRGen/ivar_destroyer.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
// CHECK-LABEL: @"$s14ivar_destroyer17NonTrivialDerivedCMf" = internal global <{ {{.*}} }> <{
1010
// CHECK-SAME: i8* null,
11-
// CHECK-SAME: i8** @"$sBoWV",
11+
// CHECK-SAME: i8** {{@"\$sBoWV"|null}},
1212
// CHECK-SAME: i64 ptrtoint ([[OBJCCLASS]]* @"$s14ivar_destroyer17NonTrivialDerivedCMm" to i64),
1313
// CHECK-SAME: [[TYPE]]* bitcast (i64* getelementptr inbounds (<{ {{.*}} }>, <{ {{.*}} }>* @"$s14ivar_destroyer11TrivialBaseCMf", i32 0, i32 2) to [[TYPE]]*),
1414
// CHECK-SAME: [[OPAQUE]]* @_objc_empty_cache,

test/IRGen/keypath_witness_overrides.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import protocol_overrides
66

77
// CHECK: @keypath = private global
8-
// CHECK-SAME: %swift.method_descriptor** @"got.$s18protocol_overrides14OriginalGetterPy7ElementQz5IndexQzcigTq"
8+
// CHECK-SAME: %swift.method_descriptor** @"{{got.|__imp_}}$s18protocol_overrides14OriginalGetterPy7ElementQz5IndexQzcigTq"
99
public func getWritableKeyPath<OS: OverridesSetter>(_ c: OS, index: OS.Index) -> AnyKeyPath
1010
where OS.Index: Hashable {
1111
let keypath = \OS.[index]

test/IRGen/keypaths.sil

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ sil_vtable C2 {}
157157
// CHECK-SAME: <i32 0x8000_000c>,
158158
// -- computed, get-only, identified by (indirected) function pointer, no args
159159
// CHECK-SAME: <i32 0x0200_0002>,
160-
// CHECK-SAME: @got.k_id
160+
// CHECK-SAME: @{{got.|__imp_}}k_id
161161
// CHECK-SAME: void (%TSi*, %T8keypaths1SV*)* @k_get
162162

163163
// -- %l: computed
@@ -169,7 +169,7 @@ sil_vtable C2 {}
169169
// CHECK-SAME: <i32 0x8000_0010>,
170170
// -- computed, settable, nonmutating, identified by indirect pointer, no args
171171
// CHECK-SAME: <i32 0x0240_0002>,
172-
// CHECK-SAME: @"got.$s8keypaths1CC1wSivgTq"
172+
// CHECK-SAME: @"{{got.|__imp_}}$s8keypaths1CC1wSivgTq"
173173
// CHECK-SAME: void (%TSi*, %T8keypaths1CC**)* @l_get
174174
// CHECK-SAME: void (%TSi*, %T8keypaths1CC**)* @l_set
175175

test/IRGen/keypaths_external.sil

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ sil @s_equals : $@convention(thin) <A: Hashable, B: Hashable> (UnsafeRawPointer,
4141
sil @s_hash : $@convention(thin) <A: Hashable, B: Hashable> (UnsafeRawPointer) -> Int
4242

4343
// -- %t
44-
// CHECK: [[KP_T:@keypath(\..*)?]] = private global <{ {{.*}} }> <{ {{.*}} i32 1, {{.*}} @"got.$s23keypaths_external_other1GV1xxvpMV"
44+
// CHECK: [[KP_T:@keypath(\..*)?]] = private global <{ {{.*}} }> <{ {{.*}} i32 1, {{.*}} @"{{got.|__imp_}}$s23keypaths_external_other1GV1xxvpMV"
4545
// CHECK-SAME: @"symbolic x"
4646
// -- computed get-only property, identified by indirect pointer
4747
// CHECK-SAME: <i32 0x0208_0002>
4848

4949
// -- %u
50-
// CHECK: [[KP_U:@keypath(\..*)?]] = private global <{ {{.*}} }> <{ {{.*}} i32 3, {{.*}} @"got.$s23keypaths_external_other1GVyxqd__cSHRd__luipMV"
50+
// CHECK: [[KP_U:@keypath(\..*)?]] = private global <{ {{.*}} }> <{ {{.*}} i32 3, {{.*}} @"{{got.|__imp_}}$s23keypaths_external_other1GVyxqd__cSHRd__luipMV"
5151
// CHECK-SAME: @"symbolic q_"
5252
// CHECK-SAME: @"symbolic x"
5353
// CHECK-SAME: @"keypath_get_witness_table

test/IRGen/property_descriptor.sil

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ sil_property #ExternalGeneric.rw <T: Comparable> (
5454
// CHECK: @"$s19property_descriptor15ExternalGenericV10computedROxvpMV" =
5555
// -- 0x0108_0000 - computed, readonly, has arguments, identified by indirect
5656
// CHECK-SAME: <{ <i32 0x0208_0002>,
57-
// CHECK-SAME: @got.id_computed
57+
// CHECK-SAME: @{{got.|__imp_}}id_computed
5858
// CHECK-SAME: [[GET_COMPUTEDRO:@keypath_get[.0-9]*]]
5959
// CHECK-SAME: [[GET_ARG_LAYOUT_COMPUTEDRO:@keypath_get_arg_layout[.0-9]*]]
6060
// -- default witness table
@@ -68,7 +68,7 @@ sil_property #ExternalGeneric.computedRO <T: Comparable> (
6868
// CHECK: @"$s19property_descriptor15ExternalGenericV10computedRWxvpMV" =
6969
// -- 0x01c8_0000 - computed, settable, mutating, has arguments, indirect id
7070
// CHECK-SAME: <{ <i32 0x02c8_0002>,
71-
// CHECK-SAME: @got.id_computed
71+
// CHECK-SAME: @{{got.|__imp_}}id_computed
7272
// CHECK-SAME: [[GET_COMPUTEDRW:@keypath_get[.0-9]*]]
7373
// CHECK-SAME: [[SET_COMPUTEDRW:@keypath_set[.0-9]*]]
7474
// CHECK-SAME: [[GET_ARG_LAYOUT_COMPUTEDRW:@keypath_get_arg_layout[.0-9]*]]
@@ -83,7 +83,7 @@ sil_property #ExternalGeneric.computedRW <T: Comparable> (
8383
// CHECK: @"$s19property_descriptor15ExternalGenericVyxqd__cSHRd__luipMV" =
8484
// -- 0x01c8_0000 - computed, settable, mutating, has arguments, indirect id
8585
// CHECK-SAME: <{ <i32 0x02c8_0002>,
86-
// CHECK-SAME: @got.id_computed
86+
// CHECK-SAME: @{{got.|__imp_}}id_computed
8787
// CHECK-SAME: [[GET_SUBSCRIPT:@keypath_get[.0-9]*]]
8888
// CHECK-SAME: [[SET_SUBSCRIPT:@keypath_set[.0-9]*]]
8989
// CHECK-SAME: [[GET_ARG_LAYOUT_SUBSCRIPT:@keypath_get_arg_layout[.0-9]*]]

test/IRGen/protocol_resilience_descriptors.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
// CHECK: @"default assoc type \01____y2T118resilient_protocol29ProtocolWithAssocTypeDefaultsPQzG 18resilient_protocol7WrapperV" =
1919

2020
// Protocol descriptor
21-
// CHECK-DEFINITION-LABEL: @"$s18resilient_protocol29ProtocolWithAssocTypeDefaultsMp" ={{( protected)?}} constant
21+
// CHECK-DEFINITION-LABEL: @"$s18resilient_protocol29ProtocolWithAssocTypeDefaultsMp" ={{( dllexport)?}}{{( protected)?}} constant
2222
// CHECK-DEFINITION-SAME: @"default associated conformance2T218resilient_protocol29ProtocolWithAssocTypeDefaultsP_AB014OtherResilientD0"
2323

2424
// Associated type default + flags

test/IRGen/subclass.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// CHECK: @_DATA__TtC8subclass1A = private constant {{.* } }}{
1414
// CHECK: @"$s8subclass1ACMf" = internal global [[A_METADATA:<{.* }>]] <{
1515
// CHECK-SAME: void ([[A]]*)* @"$s8subclass1ACfD",
16-
// CHECK-SAME: i8** @"$sBoWV",
16+
// CHECK-SAME: i8** {{@"\$sBoWV"|null}},
1717
// CHECK-SAME: i64 ptrtoint ([[OBJC_CLASS]]* @"$s8subclass1ACMm" to i64),
1818
// CHECK-SAME: [[OBJC_CLASS]]* @"OBJC_CLASS_$_{{(_TtCs12_)?}}SwiftObject",
1919
// CHECK-SAME: [[OPAQUE]]* @_objc_empty_cache,
@@ -25,7 +25,7 @@
2525
// CHECK: @_DATA__TtC8subclass1B = private constant {{.* } }}{
2626
// CHECK: @"$s8subclass1BCMf" = internal global <{ {{.*}} }> <{
2727
// CHECK-SAME: void ([[B]]*)* @"$s8subclass1BCfD",
28-
// CHECK-SAME: i8** @"$sBoWV",
28+
// CHECK-SAME: i8** {{@"\$sBoWV"|null}},
2929
// CHECK-SAME: i64 ptrtoint ([[OBJC_CLASS]]* @"$s8subclass1BCMm" to i64),
3030
// CHECK-SAME: [[TYPE]]* {{.*}} @"$s8subclass1ACMf",
3131
// CHECK-SAME: [[OPAQUE]]* @_objc_empty_cache,

test/IRGen/vtable.sil

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ sil @$s6vtable1CCfD : $@convention(method) (@owned C) -> ()
2020

2121
// CHECK-objc: @"$s6vtable1CCMf" = internal global [[C_METADATA_T:<{.*\* }>]] <{
2222
// CHECK-objc: void ([[C]]*)* @"$s6vtable1CCfD",
23-
// CHECK-objc: i8** @"$sBoWV",
23+
// CHECK-objc: i8** {{@"\$sBoWV"|null}},
2424
// CHECK-objc: i64 ptrtoint (%objc_class* @"$s6vtable1CCMm" to i64),
2525
// CHECK-objc: %objc_class* @"OBJC_CLASS_$_{{(_TtCs12_)?}}SwiftObject",
2626
// CHECK-objc: %swift.opaque* @_objc_empty_cache,
@@ -34,7 +34,7 @@ sil @$s6vtable1CCfD : $@convention(method) (@owned C) -> ()
3434

3535
// CHECK-native: @"$s6vtable1CCMf" = internal global [[C_METADATA_T:<{.*\* }>]] <{
3636
// CHECK-native: void ([[C]]*)* @"$s6vtable1CCfD",
37-
// CHECK-native: i8** @"$sBoWV",
37+
// CHECK-native: i8** {{@"\$sBoWV"|null}},
3838
// CHECK-native: i64 0,
3939
// CHECK-native: %swift.type* null,
4040
// CHECK-native: %swift.opaque* null,

test/IRGen/vtable_symbol_linkage.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// RUN: %empty-directory(%t)
22

3-
// RUN: %target-build-swift %S/Inputs/vtable_symbol_linkage_base.swift -emit-module -emit-module-path=%t/BaseModule.swiftmodule -emit-library -module-name BaseModule -o %t/BaseModule%{target-shared-library-suffix}
4-
// RUN: %target-build-swift -I %t %s %t/BaseModule%{target-shared-library-suffix} -o %t/a.out
3+
// RUN: %target-build-swift %S/Inputs/vtable_symbol_linkage_base.swift -emit-module -emit-module-path=%t/BaseModule.swiftmodule -emit-library -module-name BaseModule -o %t/%target-library-name(BaseModule)
4+
// RUN: %target-build-swift -I %t %s -o %t/a.out -L%t -lBaseModule
55

6-
// RUN: %target-build-swift %S/Inputs/vtable_symbol_linkage_base.swift -emit-module -emit-module-path=%t/BaseModule.swiftmodule -emit-library -module-name BaseModule -o %t/BaseModule%{target-shared-library-suffix} -Xfrontend -enable-resilience -Xfrontend -enable-class-resilience
7-
// RUN: %target-build-swift -I %t %s %t/BaseModule%{target-shared-library-suffix} -o %t/a.out -Xfrontend -enable-class-resilience
6+
// RUN: %target-build-swift %S/Inputs/vtable_symbol_linkage_base.swift -emit-module -emit-module-path=%t/BaseModule.swiftmodule -emit-library -module-name BaseModule -o %t/%target-library-name(BaseModule) -Xfrontend -enable-resilience -Xfrontend -enable-class-resilience
7+
// RUN: %target-build-swift -I %t %s -o %t/a.out -Xfrontend -enable-class-resilience -L%t -lBaseModule
88

99
// Check if the program can be linked without undefined symbol errors.
1010

0 commit comments

Comments
 (0)