Skip to content

Commit e5b6141

Browse files
committed
[KeyInstr][Clang] Update tests with ret atoms
1 parent 10f161b commit e5b6141

15 files changed

+43
-4
lines changed

clang/test/KeyInstructions/agg.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ void fun(Struct a) {
2424
// CHECK: %matins = insertelement <25 x float> %3, float 0.000000e+00, i64 0, !dbg [[G4R2:!.*]]
2525
// CHECK: store <25 x float> %matins, ptr @m{{.*}}, !dbg [[G4R1:!.*]]
2626
m[0][0] = 0;
27+
28+
// CHECK: ret{{.*}}, !dbg [[RET:!.*]]
2729
}
2830

2931
// CHECK: [[G1R1]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 1)
@@ -32,3 +34,4 @@ void fun(Struct a) {
3234
// CHECK: [[G3R1]] = !DILocation({{.*}}, atomGroup: 3, atomRank: 1)
3335
// CHECK: [[G4R2]] = !DILocation({{.*}}, atomGroup: 4, atomRank: 2)
3436
// CHECK: [[G4R1]] = !DILocation({{.*}}, atomGroup: 4, atomRank: 1)
37+
// CHECK: [[RET:!.*]] = !DILocation({{.*}}, atomGroup: [[#]], atomRank: [[#]])

clang/test/KeyInstructions/assign-scalar.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ void fun() {
3434
// CHECK: %dec = add i64 %3, -1, !dbg [[G6R2:!.*]]
3535
// CHECK: store i64 %dec, ptr @g{{.*}}, !dbg [[G6R1:!.*]]
3636
g--;
37+
38+
// CHECK: ret{{.*}}, !dbg [[RET:!.*]]
3739
}
3840

3941
// CHECK: [[G1R1]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 1)
@@ -46,3 +48,4 @@ void fun() {
4648
// CHECK: [[G5R1]] = !DILocation({{.*}}, atomGroup: 5, atomRank: 1)
4749
// CHECK: [[G6R2]] = !DILocation({{.*}}, atomGroup: 6, atomRank: 2)
4850
// CHECK: [[G6R1]] = !DILocation({{.*}}, atomGroup: 6, atomRank: 1)
51+
// CHECK: [[RET:!.*]] = !DILocation({{.*}}, atomGroup: [[#]], atomRank: [[#]])

clang/test/KeyInstructions/bitfield.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ void foo(int x, S s) {
77
// CHECK: %bf.set = or i8 %bf.clear, %bf.value, !dbg [[G1R2:!.*]]
88
// CHECK: store i8 %bf.set, ptr %s, align 4, !dbg [[G1R1:!.*]]
99
s.a = x;
10+
11+
// CHECK: ret{{.*}}, !dbg [[RET:!.*]]
1012
}
1113

1214
// CHECK: [[G1R2]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 2)
1315
// CHECK: [[G1R1]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 1)
16+
// CHECK: [[RET:!.*]] = !DILocation({{.*}}, atomGroup: [[#]], atomRank: [[#]])

clang/test/KeyInstructions/builtin.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ void fun() {
5757

5858
// CHECK: call void @llvm.memset{{.*}}, !dbg [[G14R1:!.*]]
5959
__builtin___memset_chk(f4, 0, sizeof(float), -1);
60+
61+
// CHECK: ret{{.*}}, !dbg [[RET:!.*]]
6062
}
6163

6264
// CHECK: [[G1R2]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 2)
@@ -75,3 +77,4 @@ void fun() {
7577
// CHECK: [[G12R1]] = !DILocation({{.*}}, atomGroup: 12, atomRank: 1)
7678
// CHECK: [[G13R1]] = !DILocation({{.*}}, atomGroup: 13, atomRank: 1)
7779
// CHECK: [[G14R1]] = !DILocation({{.*}}, atomGroup: 14, atomRank: 1)
80+
// CHECK: [[RET:!.*]] = !DILocation({{.*}}, atomGroup: [[#]], atomRank: [[#]])

clang/test/KeyInstructions/complex.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ void test() {
2828
// CHECK: %add = fadd float %0, %1, !dbg [[G4R2:!.*]]
2929
// CHECK: store float %add, ptr getelementptr inbounds nuw ({ float, float }, ptr @ci, i32 0, i32 1){{.*}}, !dbg [[G4R1:!.*]]
3030
__imag ci = __imag ci + __imag ci;
31+
32+
// CHECK: ret{{.*}}, !dbg [[RET:!.*]]
3133
}
3234

3335
// CHECK: [[G1R2]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 2)
@@ -38,3 +40,4 @@ void test() {
3840
// CHECK: [[G3R1]] = !DILocation({{.*}}, atomGroup: 3, atomRank: 1)
3941
// CHECK: [[G4R2]] = !DILocation({{.*}}, atomGroup: 4, atomRank: 2)
4042
// CHECK: [[G4R1]] = !DILocation({{.*}}, atomGroup: 4, atomRank: 1)
43+
// CHECK: [[RET:!.*]] = !DILocation({{.*}}, atomGroup: [[#]], atomRank: [[#]])

clang/test/KeyInstructions/do.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,12 @@ void a(int A) {
2525
// CHECK: %tobool = icmp ne i32 %dec, 0, !dbg [[G2R1:!.*]]
2626
// CHECK: br i1 %tobool, label %do.body, label %do.end, !dbg [[G3R1:!.*]], !llvm.loop
2727
do { } while (--A);
28+
29+
// CHECK: ret{{.*}}, !dbg [[RET:!.*]]
2830
}
2931

3032
// CHECK: [[G1R2]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 2)
3133
// CHECK: [[G1R1]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 1)
3234
// CHECK: [[G2R1]] = !DILocation({{.*}}, atomGroup: 2, atomRank: 1)
3335
// CHECK: [[G3R1]] = !DILocation({{.*}}, atomGroup: 3, atomRank: 1)
36+
// CHECK: [[RET:!.*]] = !DILocation({{.*}}, atomGroup: [[#]], atomRank: [[#]])

clang/test/KeyInstructions/for.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ void a(int A) {
2727
// CHECK: %inc = add{{.*}}, !dbg [[G4R2:!.*]]
2828
// CHECK: store i32 %inc, ptr %i{{.*}}, !dbg [[G4R1:!.*]]
2929
for (int i = 0; i < A; ++i) { }
30+
31+
// CHECK: ret{{.*}}, !dbg [[RET:!.*]]
3032
}
3133

3234
// CHECK: [[G1R1]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 1)
@@ -35,3 +37,4 @@ void a(int A) {
3537
// CHECK: [[G5R1]] = !DILocation({{.*}}, atomGroup: 5, atomRank: 1)
3638
// CHECK: [[G4R2]] = !DILocation({{.*}}, atomGroup: 4, atomRank: 2)
3739
// CHECK: [[G4R1]] = !DILocation({{.*}}, atomGroup: 4, atomRank: 1)
40+
// CHECK: [[RET:!.*]] = !DILocation({{.*}}, atomGroup: [[#]], atomRank: [[#]])

clang/test/KeyInstructions/if.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ void a(int A) {
3131
// CHECK-CXX: br i1 %tobool4, label %if.then5, label %if.end6{{.*}}, !dbg [[G5R1:!.*]]
3232
if (int B = A; B)
3333
;
34-
#endif
34+
#endif
35+
36+
// CHECK: ret{{.*}}, !dbg [[RET:!.*]]
3537
}
3638

3739
// CHECK: [[G1R2]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 2)
@@ -44,3 +46,4 @@ void a(int A) {
4446
// CHECK-CXX: [[G4R1]] = !DILocation({{.*}}, atomGroup: 4, atomRank: 1)
4547
// CHECK-CXX: [[G5R2]] = !DILocation({{.*}}, atomGroup: 5, atomRank: 2)
4648
// CHECK-CXX: [[G5R1]] = !DILocation({{.*}}, atomGroup: 5, atomRank: 1)
49+
// CHECK: [[RET:!.*]] = !DILocation({{.*}}, atomGroup: [[#]], atomRank: [[#]])

clang/test/KeyInstructions/init-agg.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ void a() {
3333

3434
// CHECK: store i8 -86, ptr %uninit{{.*}}, !dbg [[G5R1:!.*]], !annotation
3535
char uninit; // -ftrivial-auto-var-init=pattern
36+
37+
// CHECK: ret{{.*}}, !dbg [[RET:!.*]]
3638
}
3739

3840
// CHECK: [[G1R1]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 1)
@@ -41,3 +43,4 @@ void a() {
4143
// CHECK: [[G3R1]] = !DILocation({{.*}}, atomGroup: 3, atomRank: 1)
4244
// CHECK: [[G4R1]] = !DILocation({{.*}}, atomGroup: 4, atomRank: 1)
4345
// CHECK: [[G5R1]] = !DILocation({{.*}}, atomGroup: 5, atomRank: 1)
46+
// CHECK: [[RET:!.*]] = !DILocation({{.*}}, atomGroup: [[#]], atomRank: [[#]])

clang/test/KeyInstructions/init-member.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ void fun() {
1717

1818
// CHECK: store i32 1, ptr %x{{.*}}, !dbg [[G1R1:!.*]]
1919
// CHECK: store float 5.000000e+00, ptr %y{{.*}}, !dbg [[G2R1:!.*]]
20+
// CHECK: ret{{.*}}, !dbg [[RET:!.*]]
2021

2122
// CHECK: [[G1R1]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 1)
2223
// CHECK: [[G2R1]] = !DILocation({{.*}}, atomGroup: 2, atomRank: 1)
24+
// CHECK: [[RET:!.*]] = !DILocation({{.*}}, atomGroup: [[#]], atomRank: [[#]])

clang/test/KeyInstructions/init-scalar.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ void a() {
1010
// CHECK: %add = add {{.*}}, !dbg [[G2R2:!.*]]
1111
// CHECK: store i32 %add, ptr %B, align 4, !dbg [[G2R1:!.*]]
1212
int B = 2 * A + 1;
13-
// CHECK-TODO: ret{{.*}}, !dbg [[G3R1:!.*]]
13+
// CHECK: ret{{.*}}, !dbg [[G3R1:!.*]]
1414
}
1515

1616
// CHECK: [[G1R1]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 1)
1717
// CHECK: [[G2R2]] = !DILocation({{.*}}, atomGroup: 2, atomRank: 2)
1818
// CHECK: [[G2R1]] = !DILocation({{.*}}, atomGroup: 2, atomRank: 1)
19-
// CHECK-TODO: [[G3R1]] = !DILocation({{.*}}, atomGroup: 3, atomRank: 1)
19+
// CHECK: [[G3R1]] = !DILocation({{.*}}, atomGroup: 3, atomRank: 1)

clang/test/KeyInstructions/init-static.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ void g(int *a) {
55
// CHECK: %2 = load ptr, ptr %a.addr{{.*}}, !dbg [[G1R2:!.*]]
66
// CHECK: store ptr %2, ptr @_ZZ1gPiE1b{{.*}}, !dbg [[G1R1:!.*]]
77
static int &b = *a;
8+
// CHECK: ret{{.*}}, !dbg [[RET:!.*]]
89
}
910

1011
// CHECK: [[G1R2]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 2)
1112
// CHECK: [[G1R1]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 1)
12-
13+
// CHECK: [[RET:!.*]] = !DILocation({{.*}}, atomGroup: [[#]], atomRank: [[#]])

clang/test/KeyInstructions/switch.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ void a(int A, int B) {
4141
} break;
4242
default: break;
4343
}
44+
45+
// CHECK: ret{{.*}}, !dbg [[RET:!.*]]
4446
}
4547

4648
// CHECK: [[G2R2]] = !DILocation({{.*}}, atomGroup: 2, atomRank: 2)
@@ -49,3 +51,4 @@ void a(int A, int B) {
4951
// CHECK: [[G3R2]] = !DILocation({{.*}}, atomGroup: 3, atomRank: 2)
5052
// CHECK: [[G3R1]] = !DILocation({{.*}}, atomGroup: 3, atomRank: 1)
5153
// CHECK-CXX: [[G4R1]] = !DILocation({{.*}}, atomGroup: 4, atomRank: 1)
54+
// CHECK: [[RET:!.*]] = !DILocation({{.*}}, atomGroup: [[#]], atomRank: [[#]])

clang/test/KeyInstructions/try-catch.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ void attempt() {
1414
// CHECK: store i32 %5, ptr %e{{.*}}, !dbg [[G1R1:!.*]]
1515
// CHECK: call void @__cxa_end_catch()
1616
catch (int e) { }
17+
18+
// CHECK: ret{{.*}}, !dbg [[RET:!.*]]
1719
}
1820

1921
// CHECK: [[G1R2]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 2)
2022
// CHECK: [[G1R1]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 1)
23+
// CHECK: [[RET:!.*]] = !DILocation({{.*}}, atomGroup: [[#]], atomRank: [[#]])

clang/test/KeyInstructions/while.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,12 @@ void a(int A) {
2626
// CHECK: %tobool = icmp ne i32 %dec, 0, !dbg [[G2R1:!.*]]
2727
// CHECK: br i1 %tobool, label %while.body, label %while.end, !dbg [[G3R1:!.*]]
2828
while (--A) { };
29+
30+
// CHECK: ret{{.*}}, !dbg [[RET:!.*]]
2931
}
3032

3133
// CHECK: [[G1R2]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 2)
3234
// CHECK: [[G1R1]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 1)
3335
// CHECK: [[G2R1]] = !DILocation({{.*}}, atomGroup: 2, atomRank: 1)
3436
// CHECK: [[G3R1]] = !DILocation({{.*}}, atomGroup: 3, atomRank: 1)
37+
// CHECK: [[RET:!.*]] = !DILocation({{.*}}, atomGroup: [[#]], atomRank: [[#]])

0 commit comments

Comments
 (0)