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

0 commit comments

Comments
 (0)