| 1 |
// RUN: %clang_cc1 -triple x86_64-linux-gnu -gkey-instructions %s -debug-info-kind=line-tables-only -emit-llvm -o - -Wno-unused-variable \ |
| 2 |
// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank |
| 3 |
|
| 4 |
// Check both the addr-store and value-store are part of the same atom. |
| 5 |
|
| 6 |
void f(int x) { |
| 7 |
// CHECK: %call = call noalias noundef nonnull ptr @_Znwm{{.*}}, !dbg [[G1R2_C12:!.*]] |
| 8 |
// CHECK: %0 = load i32, ptr %x.addr{{.*}}, !dbg [[G1R2_C20:!.*]] |
| 9 |
// CHECK: store i32 %0, ptr %call{{.*}}, !dbg [[G1R1_C12:!.*]] |
| 10 |
// CHECK: store ptr %call, ptr %{{.*}}, !dbg [[G1R1_C8:!.*]] |
| 11 |
int *n = new int(x); |
| 12 |
// CHECK: %call1 = call noalias noundef nonnull ptr @_Znwm{{.*}}, !dbg [[G2R2_C7:!.*]] |
| 13 |
// CHECK: %1 = load i32, ptr %x.addr{{.*}}, !dbg [[G2R2_C15:!.*]] |
| 14 |
// CHECK: store i32 %1, ptr %call{{.*}}, !dbg [[G2R1_C7:!.*]] |
| 15 |
// CHECK: store ptr %call1, ptr %{{.*}}, !dbg [[G2R1_C5:!.*]] |
| 16 |
n = new int(x); |
| 17 |
// CHECK: %2 = load i32, ptr %x.addr{{.*}}, !dbg [[G3R2:!.*]] |
| 18 |
// CHECK: %3 = load ptr, ptr %n |
| 19 |
// CHECK: store i32 %2, ptr %3{{.*}}, !dbg [[G3R1:!.*]] |
| 20 |
*n = x; |
| 21 |
// CHECK: ret{{.*}}, !dbg [[RET:!.*]] |
| 22 |
} |
| 23 |
|
| 24 |
// CHECK: [[G1R2_C12]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 2) |
| 25 |
// CHECK: [[G1R2_C20]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 2) |
| 26 |
// CHECK: [[G1R1_C12]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 1) |
| 27 |
// CHECK: [[G1R1_C8]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 1) |
| 28 |
|
| 29 |
// CHECK: [[G2R2_C7]] = !DILocation({{.*}}, atomGroup: 2, atomRank: 2) |
| 30 |
// CHECK: [[G2R2_C15]] = !DILocation({{.*}}, atomGroup: 2, atomRank: 2) |
| 31 |
// CHECK: [[G2R1_C7]] = !DILocation({{.*}}, atomGroup: 2, atomRank: 1) |
| 32 |
// CHECK: [[G2R1_C5]] = !DILocation({{.*}}, atomGroup: 2, atomRank: 1) |
| 33 |
|
| 34 |
// CHECK: [[G3R2]] = !DILocation({{.*}}, atomGroup: 3, atomRank: 2) |
| 35 |
// CHECK: [[G3R1]] = !DILocation({{.*}}, atomGroup: 3, atomRank: 1) |
| 36 |
|
| 37 |
// CHECK: [[RET]] = !DILocation({{.*}}, atomGroup: 4, atomRank: 1) |