Skip to content

Commit 435a542

Browse files
committed
[KeyInstr] Fix clang tests
These broke some downstream bots for a few reasons: init-agg.c(pp) - Hard coded GEP index size. Merged init-agg.c and init-agg.cpp as that was the intention, and they diverged as a result of a bad rebase. init-static.cpp - Hard coded register names and mangling assumptions.
1 parent b6c9c76 commit 435a542

File tree

3 files changed

+24
-62
lines changed

3 files changed

+24
-62
lines changed
Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

2-
// RUN: %clang -gkey-instructions -x c++ %s -gmlt -gno-column-info -S -emit-llvm -o - -ftrivial-auto-var-init=pattern \
2+
// RUN: %clang_cc1 -x c++ -gkey-instructions %s -debug-info-kind=line-tables-only -gno-column-info -emit-llvm -o - -ftrivial-auto-var-init=pattern \
33
// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank
44

5-
// RUN: %clang -gkey-instructions -x c %s -gmlt -gno-column-info -S -emit-llvm -o - -ftrivial-auto-var-init=pattern \
5+
// RUN: %clang_cc1 -x c -gkey-instructions %s -debug-info-kind=line-tables-only -gno-column-info -emit-llvm -o - -ftrivial-auto-var-init=pattern \
66
// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank
77

88
// The implicit-check-not is important; we don't want the GEPs created for the
@@ -13,17 +13,24 @@ void a() {
1313
// CHECK: call void @llvm.memcpy{{.*}}%A{{.*}}, !dbg [[G1R1:!.*]]
1414
int A[] = { 1, 2, 3 };
1515

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]]
16+
// CHECK: call void @llvm.memcpy{{.*}}%B{{.*}}, !dbg [[G2R1:!.*]]
17+
// CHECK-NEXT: store i32 1, ptr %B{{.*}}, !dbg [[G2R1:!.*]]
18+
// CHECK-NEXT: %arrayinit.element = getelementptr {{.*}}, ptr %B, {{.*}} 1, !dbg [[B_LINE:!.*]]
19+
// CHECK-NEXT: store i32 2, ptr %arrayinit.element{{.*}}, !dbg [[G2R1]]
20+
// CHECK-NEXT: %arrayinit.element1 = getelementptr {{.*}}, ptr %B, {{.*}} 2, !dbg [[B_LINE]]
21+
// CHECK-NEXT: %0 = load i32, ptr @g{{.*}}, !dbg [[G2R2:!.*]]
22+
// CHECK-NEXT: store i32 %0, ptr %arrayinit.element1{{.*}}, !dbg [[G2R1]]
2023
int B[] = { 1, 2, g };
2124

22-
// CHECK: call void @llvm.memset{{.*}}%big{{.*}}, !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]]
25+
// CHECK: call void @llvm.memset{{.*}}%big{{.*}} !dbg [[G3R1:!.*]]
26+
// CHECK-NEXT: %1 = getelementptr {{.*}}, ptr %big, {{.*}} 0, {{.*}} 0, !dbg [[big_LINE:!.*]]
27+
// CHECK-NEXT: store i8 97, ptr %1{{.*}}, !dbg [[G3R1]]
28+
// CHECK-NEXT: %2 = getelementptr {{.*}}, ptr %big, {{.*}} 0, {{.*}} 1, !dbg [[big_LINE]]
29+
// CHECK-NEXT: store i8 98, ptr %2{{.*}}, !dbg [[G3R1]]
30+
// CHECK-NEXT: %3 = getelementptr {{.*}}, ptr %big, {{.*}} 0, {{.*}} 2, !dbg [[big_LINE]]
31+
// CHECK-NEXT: store i8 99, ptr %3{{.*}}, !dbg [[G3R1]]
32+
// CHECK-NEXT: %4 = getelementptr {{.*}}, ptr %big, {{.*}} 0, {{.*}} 3, !dbg [[big_LINE]]
33+
// CHECK: store i8 100, ptr %4{{.*}} !dbg [[G3R1]]
2734
char big[65536] = { 'a', 'b', 'c', 'd' };
2835

2936
// CHECK: call void @llvm.memset{{.*}}%arr{{.*}}, !dbg [[G4R1:!.*]]
@@ -35,7 +42,9 @@ void a() {
3542

3643
// CHECK: [[G1R1]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 1)
3744
// CHECK: [[G2R1]] = !DILocation({{.*}}, atomGroup: 2, atomRank: 1)
45+
// CHECK: [[B_LINE]] = !DILocation(line: 23, scope: ![[#]])
3846
// CHECK: [[G2R2]] = !DILocation({{.*}}, atomGroup: 2, atomRank: 2)
3947
// CHECK: [[G3R1]] = !DILocation({{.*}}, atomGroup: 3, atomRank: 1)
48+
// CHECK: [[big_LINE]] = !DILocation(line: 34, scope: ![[#]])
4049
// CHECK: [[G4R1]] = !DILocation({{.*}}, atomGroup: 4, atomRank: 1)
4150
// CHECK: [[G5R1]] = !DILocation({{.*}}, atomGroup: 5, atomRank: 1)

clang/test/DebugInfo/KeyInstructions/init-agg.cpp

Lines changed: 0 additions & 48 deletions
This file was deleted.

clang/test/DebugInfo/KeyInstructions/init-static.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
// RUN: %clang_cc1 -gkey-instructions %s -debug-info-kind=line-tables-only -emit-llvm -o -\
22
// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank
33

4+
// CHECK: [[b_addr:@.*]] = {{.*}}global ptr
5+
46
void g(int *a) {
5-
// CHECK: %2 = load ptr, ptr %a.addr{{.*}}, !dbg [[G1R2:!.*]]
6-
// CHECK: store ptr %2, ptr @_ZZ1gPiE1b{{.*}}, !dbg [[G1R1:!.*]]
7+
// CHECK: [[v:%.*]] = load ptr, ptr %a.addr{{.*}}, !dbg [[G1R2:!.*]]
8+
// CHECK: store ptr [[v]], ptr [[b_addr]]{{.*}}, !dbg [[G1R1:!.*]]
79
static int &b = *a;
810
}
911

1012
// CHECK: [[G1R2]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 2)
1113
// CHECK: [[G1R1]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 1)
12-

0 commit comments

Comments
 (0)