Skip to content

Commit bbed74b

Browse files
committed
Use FileCheck to ignore SSA vals
1 parent a2e8974 commit bbed74b

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

Tests/LLVMTests/IRBuilderSpec.swift

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -46,44 +46,43 @@ class IRBuilderSpec : XCTestCase {
4646
let entry = main.appendBasicBlock(named: "entry")
4747
builder.positionAtEnd(of: entry)
4848

49-
// IRBUILDERARITH-NEXT: %0 = load i32, i32* @a
49+
// IRBUILDERARITH-NEXT: [[A_LOAD:%[0-9]+]] = load i32, i32* @a
5050
let vg1 = builder.buildLoad(g1)
51-
// IRBUILDERARITH-NEXT: %1 = load i32, i32* @b
51+
// IRBUILDERARITH-NEXT: [[B_LOAD:%[0-9]+]] = load i32, i32* @b
5252
let vg2 = builder.buildLoad(g2)
5353

54-
// IRBUILDERARITH-NEXT: %2 = add i32 %0, %1
54+
// IRBUILDERARITH-NEXT: {{%[0-9]+}} = add i32 [[A_LOAD]], [[B_LOAD]]
5555
_ = builder.buildAdd(vg1, vg2)
56-
// IRBUILDERARITH-NEXT: %3 = sub i32 %0, %1
56+
// IRBUILDERARITH-NEXT: {{%[0-9]+}} = sub i32 [[A_LOAD]], [[B_LOAD]]
5757
_ = builder.buildSub(vg1, vg2)
58-
// IRBUILDERARITH-NEXT: %4 = mul i32 %0, %1
58+
// IRBUILDERARITH-NEXT: {{%[0-9]+}} = mul i32 [[A_LOAD]], [[B_LOAD]]
5959
_ = builder.buildMul(vg1, vg2)
60-
// IRBUILDERARITH-NEXT: %5 = sdiv i32 %0, %1
60+
// IRBUILDERARITH-NEXT: {{%[0-9]+}} = sdiv i32 [[A_LOAD]], [[B_LOAD]]
6161
_ = builder.buildDiv(vg1, vg2, signed: true)
62-
// IRBUILDERARITH-NEXT: %6 = udiv i32 %0, %1
62+
// IRBUILDERARITH-NEXT: {{%[0-9]+}} = udiv i32 [[A_LOAD]], [[B_LOAD]]
6363
_ = builder.buildDiv(vg1, vg2, signed: false)
6464

65-
// IRBUILDERARITH-NEXT: %7 = add nsw i32 %0, %1
65+
// IRBUILDERARITH-NEXT: {{%[0-9]+}} = add nsw i32 [[A_LOAD]], [[B_LOAD]]
6666
_ = builder.buildAdd(vg1, vg2, overflowBehavior: .noSignedWrap)
67-
// IRBUILDERARITH-NEXT: %8 = sub nsw i32 %0, %1
67+
// IRBUILDERARITH-NEXT: {{%[0-9]+}} = sub nsw i32 [[A_LOAD]], [[B_LOAD]]
6868
_ = builder.buildSub(vg1, vg2, overflowBehavior: .noSignedWrap)
69-
// IRBUILDERARITH-NEXT: %9 = mul nsw i32 %0, %1
69+
// IRBUILDERARITH-NEXT: {{%[0-9]+}} = mul nsw i32 [[A_LOAD]], [[B_LOAD]]
7070
_ = builder.buildMul(vg1, vg2, overflowBehavior: .noSignedWrap)
7171

72-
// IRBUILDERARITH-NEXT: %10 = add nuw i32 %0, %1
72+
// IRBUILDERARITH-NEXT: {{%[0-9]+}} = add nuw i32 [[A_LOAD]], [[B_LOAD]]
7373
_ = builder.buildAdd(vg1, vg2, overflowBehavior: .noUnsignedWrap)
74-
// IRBUILDERARITH-NEXT: %11 = sub nuw i32 %0, %1
74+
// IRBUILDERARITH-NEXT: {{%[0-9]+}} = sub nuw i32 [[A_LOAD]], [[B_LOAD]]
7575
_ = builder.buildSub(vg1, vg2, overflowBehavior: .noUnsignedWrap)
76-
// IRBUILDERARITH-NEXT: %12 = mul nuw i32 %0, %1
76+
// IRBUILDERARITH-NEXT: {{%[0-9]+}} = mul nuw i32 [[A_LOAD]], [[B_LOAD]]
7777
_ = builder.buildMul(vg1, vg2, overflowBehavior: .noUnsignedWrap)
7878

79-
// IRBUILDERARITH-NEXT: %13 = sub i32 0, %0
79+
// IRBUILDERARITH-NEXT: {{%[0-9]+}} = sub i32 0, [[A_LOAD]]
8080
_ = builder.buildNeg(vg1, overflowBehavior: .default)
81-
// IRBUILDERARITH-NEXT: %14 = sub nuw i32 0, %0
81+
// IRBUILDERARITH-NEXT: {{%[0-9]+}} = sub nuw i32 0, [[A_LOAD]]
8282
_ = builder.buildNeg(vg1, overflowBehavior: .noUnsignedWrap)
83-
// IRBUILDERARITH-NEXT: %15 = sub nsw i32 0, %0
83+
// IRBUILDERARITH-NEXT: {{%[0-9]+}} = sub nsw i32 0, [[A_LOAD]]
8484
_ = builder.buildNeg(vg1, overflowBehavior: .noSignedWrap)
8585

86-
8786
// IRBUILDERARITH-NEXT: ret void
8887
builder.buildRetVoid()
8988
// IRBUILDERARITH-NEXT: }

0 commit comments

Comments
 (0)