|
1 | 1 | // RUN: %clang -gkey-instructions -gno-column-info -x c++ %s -gmlt -S -emit-llvm -o - -target x86_64-unknown-linux \
|
2 |
| -// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank |
| 2 | +// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank --check-prefixes=CHECK,CHECK-CXX |
3 | 3 |
|
4 | 4 | // RUN: %clang -gkey-instructions -gno-column-info -x c %s -gmlt -S -emit-llvm -o - -target x86_64-unknown-linux \
|
5 |
| -// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank |
| 5 | +// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank --check-prefixes=CHECK,CHECK-C |
6 | 6 |
|
7 | 7 | typedef struct {
|
8 | 8 | void* a;
|
9 | 9 | void* b;
|
10 | 10 | } Struct;
|
11 |
| - |
12 | 11 | Struct get();
|
13 |
| -void store() { |
14 |
| - // CHECK: %1 = extractvalue { ptr, ptr } %call, 0, !dbg [[G1R2:!.*]] |
15 |
| - // CHECK: store ptr %1, ptr {{.*}}, !dbg [[G1R1:!.*]] |
16 |
| - // CHECK: %3 = extractvalue { ptr, ptr } %call, 1, !dbg [[G1R2]] |
17 |
| - // CHECK: store ptr %3, ptr {{.*}}, !dbg [[G1R1:!.*]] |
| 12 | + |
| 13 | +void test() { |
| 14 | +// CHECK: %1 = extractvalue { ptr, ptr } %call, 0, !dbg [[G1R2:!.*]] |
| 15 | +// CHECK: store ptr %1, ptr {{.*}}, !dbg [[G1R1:!.*]] |
| 16 | +// CHECK: %3 = extractvalue { ptr, ptr } %call, 1, !dbg [[G1R2]] |
| 17 | +// CHECK: store ptr %3, ptr {{.*}}, !dbg [[G1R1:!.*]] |
18 | 18 | Struct s = get();
|
19 |
| - // CHECK: ret void, !dbg [[G2R1:!.*]] |
| 19 | +// CHECK: ret void, !dbg [[G2R1:!.*]] |
| 20 | +} |
| 21 | + |
| 22 | +typedef struct { int i; } Int; |
| 23 | +Int getInt(void); |
| 24 | + |
| 25 | +// CHECK-C: @test2 |
| 26 | +// CHECK-CXX: @_Z5test2v |
| 27 | +void test2() { |
| 28 | +// CHECK: %call = call i32 @{{(_Z6)?}}getInt{{v?}}(), !dbg [[T2_G1R2:!.*]] |
| 29 | +// CHECK: [[gep:%.*]] = getelementptr inbounds nuw %struct.Int, ptr %i, i32 0, i32 0 |
| 30 | +// CHECK: store i32 %call, ptr [[gep]]{{.*}}, !dbg [[T2_G1R1:!.*]] |
| 31 | + Int i = getInt(); |
| 32 | +// CHECK: ret void, !dbg [[T2_G2R1:!.*]] |
20 | 33 | }
|
21 | 34 |
|
22 | 35 | // CHECK: [[G1R2]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 2)
|
23 | 36 | // CHECK: [[G1R1]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 1)
|
24 | 37 | // CHECK: [[G2R1]] = !DILocation({{.*}}, atomGroup: 2, atomRank: 1)
|
| 38 | +// CHECK: [[T2_G1R2]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 2) |
| 39 | +// CHECK: [[T2_G1R1]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 1) |
| 40 | +// CHECK: [[T2_G2R1]] = !DILocation({{.*}}, atomGroup: 2, atomRank: 1) |
0 commit comments