|
| 1 | + |
| 2 | +// RUN: %clang -gkey-instructions -x c++ %s -gmlt -gno-column-info -S -emit-llvm -o - -ftrivial-auto-var-init=pattern \ |
| 3 | +// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank |
| 4 | + |
| 5 | +// RUN: %clang -gkey-instructions -x c %s -gmlt -gno-column-info -S -emit-llvm -o - -ftrivial-auto-var-init=pattern \ |
| 6 | +// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank |
| 7 | + |
| 8 | +// The implicit-check-not is important; we don't want the GEPs created for the |
| 9 | +// store locations to be included in the atom group. |
| 10 | + |
| 11 | +int g; |
| 12 | +void a() { |
| 13 | +// CHECK: call void @llvm.memcpy{{.*}}, !dbg [[G1R1:!.*]] |
| 14 | + int A[] = { 1, 2, 3 }; |
| 15 | + |
| 16 | +// CHECK: store i32 1, ptr %{{.*}}, !dbg [[G2R1:!.*]] |
| 17 | +// CHECK: store i32 2, ptr %{{.*}}, !dbg [[G2R1]] |
| 18 | +// CHECK: %0 = load i32, ptr @g{{.*}}, !dbg [[G2R2:!.*]] |
| 19 | +// CHECK: store i32 %0, ptr %{{.*}}, !dbg [[G2R1]] |
| 20 | + int B[] = { 1, 2, g }; |
| 21 | + |
| 22 | +// CHECK: call void @llvm.memset{{.*}}, !dbg [[G3R1:!.*]] |
| 23 | +// CHECK: store i8 97{{.*}}, !dbg [[G3R1]] |
| 24 | +// CHECK: store i8 98{{.*}}, !dbg [[G3R1]] |
| 25 | +// CHECK: store i8 99{{.*}}, !dbg [[G3R1]] |
| 26 | +// CHECK: store i8 100{{.*}}, !dbg [[G3R1]] |
| 27 | + char big[65536] = { 'a', 'b', 'c', 'd' }; |
| 28 | + |
| 29 | +// CHECK: call void @llvm.memset{{.*}}, !dbg [[G4R1:!.*]] |
| 30 | + char arr[] = { 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, }; |
| 31 | + |
| 32 | +// CHECK: store i8 -86, ptr %uninit{{.*}}, !dbg [[G5R1:!.*]], !annotation |
| 33 | + char uninit; // -ftrivial-auto-var-init=pattern |
| 34 | +} |
| 35 | + |
| 36 | +// CHECK: [[G1R1]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 1) |
| 37 | +// CHECK: [[G2R1]] = !DILocation({{.*}}, atomGroup: 2, atomRank: 1) |
| 38 | +// CHECK: [[G2R2]] = !DILocation({{.*}}, atomGroup: 2, atomRank: 2) |
| 39 | +// CHECK: [[G3R1]] = !DILocation({{.*}}, atomGroup: 3, atomRank: 1) |
| 40 | +// CHECK: [[G4R1]] = !DILocation({{.*}}, atomGroup: 4, atomRank: 1) |
| 41 | +// CHECK: [[G5R1]] = !DILocation({{.*}}, atomGroup: 5, atomRank: 1) |
0 commit comments