Skip to content

Commit b616249

Browse files
committed
Update tests to expect auto-generated argument names
Per LLVM 10.0 release notes: "Unnamed function arguments now get printed with their automatically generated name (e.g. “i32 %0”) in definitions. This may require front-ends to update their tests; if so there is a script utils/add_argument_names.py that correctly converted 80-90% of Clang tests. Some manual work will almost certainly still be needed."
1 parent 628666d commit b616249

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

Tests/LLVMTests/IRAttributesSpec.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class IRAttributesSpec : XCTestCase {
1414
type: FunctionType([IntType.int32, IntType.int32],
1515
IntType.int32))
1616

17-
// FNATTR: define i32 @fn(i32, i32) #0 {
17+
// FNATTR: define i32 @fn(i32 %0, i32 %1) #0 {
1818
fn.addAttribute(.nounwind, to: .function)
1919

2020
// FNATTR-NEXT: entry:
@@ -36,7 +36,7 @@ class IRAttributesSpec : XCTestCase {
3636
type: FunctionType([IntType.int32, IntType.int32],
3737
IntType.int32))
3838

39-
// RVATTR: define signext i32 @fn(i32, i32) {
39+
// RVATTR: define signext i32 @fn(i32 %0, i32 %1) {
4040
fn.addAttribute(.signext, to: .returnValue)
4141

4242
// RVATTR-NEXT: entry:
@@ -58,7 +58,7 @@ class IRAttributesSpec : XCTestCase {
5858
type: FunctionType([IntType.int32, i8ptr],
5959
IntType.int32))
6060

61-
// ARGATTR: define i32 @fn(i32 zeroext, i8* align 8) {
61+
// ARGATTR: define i32 @fn(i32 zeroext %0, i8* align 8 %1) {
6262
fn.addAttribute(.zeroext, to: .argument(0))
6363
fn.addAttribute(.align, value: 8, to: .argument(1))
6464

Tests/LLVMTests/IRIntrinsicSpec.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class IRIntrinsicSpec : XCTestCase {
1313
let module = Module(name: "IRIntrinsicTest")
1414
let builder = IRBuilder(module: module)
1515

16-
// IRINTRINSIC: define i32 @readOneArg(i32, ...) {
16+
// IRINTRINSIC: define i32 @readOneArg(i32 %0, ...) {
1717
let main = builder.addFunction("readOneArg",
1818
type: FunctionType([IntType.int32],
1919
IntType.int32,
@@ -53,13 +53,13 @@ class IRIntrinsicSpec : XCTestCase {
5353
module.dump()
5454

5555
// IRINTRINSIC: ; Function Attrs: nounwind
56-
// IRINTRINSIC-NEXT: declare void @llvm.va_start(i8*) #0
56+
// IRINTRINSIC-NEXT: declare void @llvm.va_start(i8* %0) #0
5757

5858
// IRINTRINSIC: ; Function Attrs: nounwind
59-
// IRINTRINSIC-NEXT: declare void @llvm.va_copy(i8*, i8*) #0
59+
// IRINTRINSIC-NEXT: declare void @llvm.va_copy(i8* %0, i8* %1) #0
6060

6161
// IRINTRINSIC: ; Function Attrs: nounwind
62-
// IRINTRINSIC-NEXT: declare void @llvm.va_end(i8*) #0
62+
// IRINTRINSIC-NEXT: declare void @llvm.va_end(i8* %0) #0
6363
})
6464

6565
XCTAssert(fileCheckOutput(of: .stderr, withPrefixes: ["VIRTUALOVERLOAD-IRINTRINSIC"]) {
@@ -93,7 +93,7 @@ class IRIntrinsicSpec : XCTestCase {
9393
module.dump()
9494

9595
// VIRTUALOVERLOAD-IRINTRINSIC: ; Function Attrs: nounwind readnone
96-
// VIRTUALOVERLOAD-IRINTRINSIC-NEXT: declare i32* @llvm.ssa.copy.p0i32(i32* returned) #0
96+
// VIRTUALOVERLOAD-IRINTRINSIC-NEXT: declare i32* @llvm.ssa.copy.p0i32(i32* returned %0) #0
9797
})
9898

9999
XCTAssert(fileCheckOutput(of: .stderr, withPrefixes: ["INTRINSIC-FAMILY-RESOLVE"]) {

Tests/LLVMTests/IRMetadataSpec.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class IRMetadataSpec : XCTestCase {
6363
XCTAssertNil(builder.defaultFloatingPointMathTag)
6464
builder.defaultFloatingPointMathTag = MDB.buildFloatingPointMathTag(0.1)
6565

66-
// IRFPMATHMETADATA: define float @test(float, float) {
66+
// IRFPMATHMETADATA: define float @test(float %0, float %1) {
6767
let main = builder.addFunction("test",
6868
type: FunctionType([
6969
FloatType.float, FloatType.float
@@ -91,7 +91,7 @@ class IRMetadataSpec : XCTestCase {
9191
let builder = IRBuilder(module: module)
9292
let MDB = MDBuilder()
9393

94-
// IRBWMETADATA: define float @test(i1, float, float) {
94+
// IRBWMETADATA: define float @test(i1 %0, float %1, float %2) {
9595
let main = builder.addFunction("test",
9696
type: FunctionType([
9797
IntType.int1,
@@ -226,7 +226,7 @@ class IRMetadataSpec : XCTestCase {
226226
let builder = IRBuilder(module: module)
227227
let MDB = MDBuilder()
228228

229-
// IRMEMTRANSFERTBAA: define void @main(i8*) {
229+
// IRMEMTRANSFERTBAA: define void @main(i8* %0) {
230230
let F = module.addFunction("main", type: FunctionType([PointerType.toVoid], VoidType()))
231231
// IRMEMTRANSFERTBAA-NEXT: entry:
232232
let bb = F.appendBasicBlock(named: "entry")

Tests/LLVMTests/IRPassManagerSpec.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class IRPassManagerSpec : XCTestCase {
109109
// CHECK-EXECUTE-STDOPT: ; ModuleID = 'Test'
110110
// CHECK-EXECUTE-STDOPT: source_filename = "Test"
111111

112-
// CHECK-EXECUTE-STDOPT: define i32 @fun(i32, i32) {
112+
// CHECK-EXECUTE-STDOPT: define i32 @fun(i32 %0, i32 %1) {
113113
// CHECK-EXECUTE-STDOPT: entry:
114114
// CHECK-EXECUTE-STDOPT: %2 = alloca i32, align 4
115115
// CHECK-EXECUTE-STDOPT: %3 = alloca i32, align 4
@@ -148,7 +148,7 @@ class IRPassManagerSpec : XCTestCase {
148148
// CHECK-EXECUTE-STDOPT: source_filename = "Test"
149149

150150
// CHECK-EXECUTE-STDOPT: ; Function Attrs: norecurse nounwind readnone
151-
// CHECK-EXECUTE-STDOPT: define i32 @fun(i32, i32) local_unnamed_addr #0 {
151+
// CHECK-EXECUTE-STDOPT: define i32 @fun(i32 %0, i32 %1) local_unnamed_addr #0 {
152152
// CHECK-EXECUTE-STDOPT: entry:
153153
// CHECK-EXECUTE-STDOPT: %2 = icmp eq i32 %0, 1
154154
// CHECK-EXECUTE-STDOPT: %3 = add nsw i32 %1, 4
@@ -174,7 +174,7 @@ class IRPassManagerSpec : XCTestCase {
174174
// CHECK-EXECUTE-MASK: ; ModuleID = 'Test'
175175
// CHECK-EXECUTE-MASK: source_filename = "Test"
176176

177-
// CHECK-EXECUTE-MASK: define i32 @fun(i32, i32) {
177+
// CHECK-EXECUTE-MASK: define i32 @fun(i32 %0, i32 %1) {
178178
// CHECK-EXECUTE-MASK: entry:
179179
// CHECK-EXECUTE-MASK: %2 = alloca i32, align 4
180180
// CHECK-EXECUTE-MASK: %3 = alloca i32, align 4
@@ -212,7 +212,7 @@ class IRPassManagerSpec : XCTestCase {
212212
// CHECK-EXECUTE-MASK: ; ModuleID = 'Test'
213213
// CHECK-EXECUTE-MASK: source_filename = "Test"
214214

215-
// CHECK-EXECUTE-MASK: define i32 @fun(i32, i32) {
215+
// CHECK-EXECUTE-MASK: define i32 @fun(i32 %0, i32 %1) {
216216
// CHECK-EXECUTE-MASK: entry:
217217
// CHECK-EXECUTE-MASK: %2 = alloca i32, align 4
218218
// CHECK-EXECUTE-MASK: %3 = alloca i32, align 4

0 commit comments

Comments
 (0)