4
4
5
5
// UNSUPPORTED: OS=windows-msvc
6
6
7
- // rdar://102246128
8
- // REQUIRES: PTRSIZE=64
9
-
10
7
@_weakLinked import has_symbol_helper
11
8
9
+ // Match the target word size so that we can use it throughout the test
10
+ // CHECK: %swift.type = type { [[WORD:i32|i64]] }
11
+
12
12
public func testGlobalFunctions( ) {
13
13
// CHECK: %{{[0-9]+}} = call i1 @"$s17has_symbol_helper8function4withySi_tFTwS"()
14
14
if #_hasSymbol( function ( with: ) ) { }
@@ -43,7 +43,7 @@ public func testGlobalFunctions() {
43
43
44
44
// --- function(with:) ---
45
45
// CHECK: define linkonce_odr hidden i1 @"$s17has_symbol_helper8function4withySi_tFTwS"()
46
- // CHECK: ret i1 icmp ne (void ({{i32|i64}} )* @"$s17has_symbol_helper8function4withySi_tF", void (i64 )* null)
46
+ // CHECK: ret i1 icmp ne (void ([[WORD]] )* @"$s17has_symbol_helper8function4withySi_tF", void ([[WORD]] )* null)
47
47
48
48
// --- throwingFunc() ---
49
49
// CHECK: define linkonce_odr hidden i1 @"$s17has_symbol_helper12throwingFuncyyKFTwS"()
@@ -88,7 +88,7 @@ public func testVars() {
88
88
89
89
// --- global ---
90
90
// CHECK: define linkonce_odr hidden i1 @"$s17has_symbol_helper6globalSivpTwS"()
91
- // CHECK: ret i1 icmp ne (i64 ()* @"$s17has_symbol_helper6globalSivg", i64 ()* null)
91
+ // CHECK: ret i1 icmp ne ([[WORD]] ()* @"$s17has_symbol_helper6globalSivg", [[WORD]] ()* null)
92
92
93
93
public func testClass( _ c: C ) {
94
94
// CHECK: %{{[0-9]+}} = call i1 @"$s17has_symbol_helper1CCACycfcTwS"()
@@ -104,7 +104,7 @@ public func testClass(_ c: C) {
104
104
105
105
// --- C.method(with:) ---
106
106
// CHECK: define linkonce_odr hidden i1 @"$s17has_symbol_helper1CC6method4withySi_tFTwS"()
107
- // CHECK: ret i1 and (i1 icmp ne (void (i64 , %T17has_symbol_helper1CC*)* @"$s17has_symbol_helper1CC6method4withySi_tFTj", void (i64 , %T17has_symbol_helper1CC*)* null), i1 icmp ne (%swift.method_descriptor* @"$s17has_symbol_helper1CC6method4withySi_tFTq", %swift.method_descriptor* null))
107
+ // CHECK: ret i1 and (i1 icmp ne (void ([[WORD]] , %T17has_symbol_helper1CC*)* @"$s17has_symbol_helper1CC6method4withySi_tFTj", void ([[WORD]] , %T17has_symbol_helper1CC*)* null), i1 icmp ne (%swift.method_descriptor* @"$s17has_symbol_helper1CC6method4withySi_tFTq", %swift.method_descriptor* null))
108
108
109
109
public func testStruct( _ s: S ) {
110
110
// CHECK: %{{[0-9]+}} = call i1 @"$s17has_symbol_helper1SV6memberSivpTwS"()
@@ -116,11 +116,11 @@ public func testStruct(_ s: S) {
116
116
117
117
// --- S.member ---
118
118
// CHECK: define linkonce_odr hidden i1 @"$s17has_symbol_helper1SV6memberSivpTwS"()
119
- // CHECK: ret i1 and (i1 and (i1 and (i1 icmp ne (%swift.type_descriptor* @"$s17has_symbol_helper1SV6memberSivpMV", %swift.type_descriptor* null), i1 icmp ne (i64 (%swift.opaque*)* @"$s17has_symbol_helper1SV6memberSivg", i64 (%swift.opaque*)* null)), i1 icmp ne (void (i64 , %swift.opaque*)* @"$s17has_symbol_helper1SV6memberSivs", void (i64 , %swift.opaque*)* null)), i1 icmp ne ({ i8*, %TSi* } (i8*, %swift.opaque*)* @"$s17has_symbol_helper1SV6memberSivM", { i8*, %TSi* } (i8*, %swift.opaque*)* null))
119
+ // CHECK: ret i1 and (i1 and (i1 and (i1 icmp ne (%swift.type_descriptor* @"$s17has_symbol_helper1SV6memberSivpMV", %swift.type_descriptor* null), i1 icmp ne ([[WORD]] (%swift.opaque*)* @"$s17has_symbol_helper1SV6memberSivg", [[WORD]] (%swift.opaque*)* null)), i1 icmp ne (void ([[WORD]] , %swift.opaque*)* @"$s17has_symbol_helper1SV6memberSivs", void ([[WORD]] , %swift.opaque*)* null)), i1 icmp ne ({ i8*, %TSi* } (i8*, %swift.opaque*)* @"$s17has_symbol_helper1SV6memberSivM", { i8*, %TSi* } (i8*, %swift.opaque*)* null))
120
120
121
121
// --- S.method(with:) ---
122
122
// CHECK: define linkonce_odr hidden i1 @"$s17has_symbol_helper1SV6method4withySi_tFTwS"()
123
- // CHECK: ret i1 icmp ne (void (i64 , %swift.opaque*)* @"$s17has_symbol_helper1SV6method4withySi_tF", void (i64 , %swift.opaque*)* null)
123
+ // CHECK: ret i1 icmp ne (void ([[WORD]] , %swift.opaque*)* @"$s17has_symbol_helper1SV6method4withySi_tF", void ([[WORD]] , %swift.opaque*)* null)
124
124
125
125
public func testEnum( _ e: E ) {
126
126
// CHECK: %{{[0-9]+}} = call i1 @"$s17has_symbol_helper1EO9basicCaseyA2CmFTwS"()
@@ -169,4 +169,4 @@ public func testMetatypes() {
169
169
170
170
// --- S.self ---
171
171
// CHECK: define linkonce_odr hidden i1 @"$s17has_symbol_helper1SVTwS"()
172
- // CHECK: ret i1 and (i1 and (i1 icmp ne (%swift.type_descriptor* @"$s17has_symbol_helper1SVMn", %swift.type_descriptor* null), i1 icmp ne (%swift.type* @"$s17has_symbol_helper1SVN", %swift.type* null)), i1 icmp ne (%swift.metadata_response (i64 )* @"$s17has_symbol_helper1SVMa", %swift.metadata_response (i64 )* null))
172
+ // CHECK: ret i1 and (i1 and (i1 icmp ne (%swift.type_descriptor* @"$s17has_symbol_helper1SVMn", %swift.type_descriptor* null), i1 icmp ne (%swift.type* @"$s17has_symbol_helper1SVN", %swift.type* null)), i1 icmp ne (%swift.metadata_response ([[WORD]] )* @"$s17has_symbol_helper1SVMa", %swift.metadata_response ([[WORD]] )* null))
0 commit comments