Skip to content

Commit 00c3b67

Browse files
committed
IRGen: Support 32-bit targets in IRGen/has_symbol.swift
Resolves rdar://102246128
1 parent 5956544 commit 00c3b67

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

test/IRGen/has_symbol.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
// UNSUPPORTED: OS=windows-msvc
66

7-
// rdar://102246128
8-
// REQUIRES: PTRSIZE=64
9-
107
@_weakLinked import has_symbol_helper
118

9+
// Match the target word size so that we can use it throughout the test
10+
// CHECK: %swift.type = type { [[WORD:i32|i64]] }
11+
1212
public func testGlobalFunctions() {
1313
// CHECK: %{{[0-9]+}} = call i1 @"$s17has_symbol_helper8function4withySi_tFTwS"()
1414
if #_hasSymbol(function(with:)) {}
@@ -43,7 +43,7 @@ public func testGlobalFunctions() {
4343

4444
// --- function(with:) ---
4545
// 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)
4747

4848
// --- throwingFunc() ---
4949
// CHECK: define linkonce_odr hidden i1 @"$s17has_symbol_helper12throwingFuncyyKFTwS"()
@@ -88,7 +88,7 @@ public func testVars() {
8888

8989
// --- global ---
9090
// 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)
9292

9393
public func testClass(_ c: C) {
9494
// CHECK: %{{[0-9]+}} = call i1 @"$s17has_symbol_helper1CCACycfcTwS"()
@@ -104,7 +104,7 @@ public func testClass(_ c: C) {
104104

105105
// --- C.method(with:) ---
106106
// 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))
108108

109109
public func testStruct(_ s: S) {
110110
// CHECK: %{{[0-9]+}} = call i1 @"$s17has_symbol_helper1SV6memberSivpTwS"()
@@ -116,11 +116,11 @@ public func testStruct(_ s: S) {
116116

117117
// --- S.member ---
118118
// 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))
120120

121121
// --- S.method(with:) ---
122122
// 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)
124124

125125
public func testEnum(_ e: E) {
126126
// CHECK: %{{[0-9]+}} = call i1 @"$s17has_symbol_helper1EO9basicCaseyA2CmFTwS"()
@@ -169,4 +169,4 @@ public func testMetatypes() {
169169

170170
// --- S.self ---
171171
// 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

Comments
 (0)