Skip to content

Commit b787ea4

Browse files
authored
Merge pull request #11739 from delcypher/dliew/fix-bs-tests-after-macro-debug-info-change-stable-21.x
[BoundsSafety] Fix tests broken by change to how debug info in macros is handled
2 parents 846a7e5 + 3be2022 commit b787ea4

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

clang/test/BoundsSafety/CodeGen/opt-remarks/bounds-safety-ptr-conversion-O0.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ int main(int argc, char **argv) {
1717
// IR: store ptr %argv, ptr %[[ARGV_ALLOCA:[a-z0-9.]+]]
1818
// IR: %[[ARGV:[a-z0-9.]+]] = load ptr, ptr %[[ARGV_ALLOCA]]{{.*}}
1919
// IR: %[[ARGV_DEREF:[a-z0-9.]+]] = load ptr, ptr %[[ARGV]]{{.*}}
20-
// IR: %[[LEN_DEREF:[a-z0-9.]+]] = load i32, ptr %{{.*}}, !dbg ![[LOC_11_20:[0-9]+]]
21-
// IR: %[[LEN_EXT:[a-z0-9.]+]] = sext i32 %[[LEN_DEREF]] to i64, !dbg ![[LOC_11_20]]
20+
// IR: %[[LEN_DEREF:[a-z0-9.]+]] = load i32, ptr %{{.*}}, !dbg ![[LOC_11_33:[0-9]+]]
21+
// IR: %[[LEN_EXT:[a-z0-9.]+]] = sext i32 %[[LEN_DEREF]] to i64, !dbg ![[LOC_11_33]]
2222
// IR: icmp ule ptr %[[ARGV_DEREF]], {{.*}}, !dbg ![[LOC_11_37:[0-9]+]]
2323
// IR: br i1 {{.*}}, label %[[LABEL_CONT:[a-z0-9.]+]], label %[[LABEL_TRAP_RES:[a-z0-9.]+]], !dbg ![[LOC_11_37]]
2424
// ...
@@ -70,7 +70,7 @@ int main(int argc, char **argv) {
7070
// IR-DAG: ![[TRAP_LOC_11_44]] = !DILocation(line: 0, scope: ![[TRAP_INFO_11_44:[0-9]+]], inlinedAt: ![[LOC_11_44]])
7171
// IR-DAG: ![[TRAP_INFO_11_44]] = distinct !DISubprogram(name: "__clang_trap_msg$Bounds check failed$"
7272
//
73-
// IR-DAG: ![[LOC_11_20]] = !DILocation(line: 11, column: 20
73+
// IR-DAG: ![[LOC_11_33]] = !DILocation(line: 11, column: 33
7474

7575
// IR-DAG: ![[TRAP_LOC_MISSING]] = !DILocation(line: 0, scope: ![[MAIN_SCOPE:[0-9]+]])
7676
// IR-DAG: ![[MAIN_SCOPE]] = distinct !DISubprogram(name: "main", {{.*}} line: 9, {{.*}} scopeLine: 9

clang/test/BoundsSafety/CodeGen/opt-remarks/ptr-count-assignment-argc-O0.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ int main(int argc, char **argv) {
105105
// OPT-REM-NEXT: Pass: annotation-remarks
106106
// OPT-REM-NEXT: Name: BoundsSafetyCheck
107107
// OPT-REM-NEXT: DebugLoc: { File: '{{.*}}ptr-count-assignment-argc-O0.c',
108-
// OPT-REM-NEXT: Line: 11, Column: 11 }
108+
// OPT-REM-NEXT: Line: 11, Column: 24 }
109109
// OPT-REM-NEXT: Function: main
110110
// OPT-REM-NEXT: Args:
111111
// OPT-REM-NEXT: - String: 'Inserted '

clang/test/BoundsSafety/CodeGen/opt-remarks/ptr-count-assignment-const-O0.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ int main(void) {
9494
// OPT-REM-NEXT: Pass: annotation-remarks
9595
// OPT-REM-NEXT: Name: BoundsSafetyCheck
9696
// OPT-REM-NEXT: DebugLoc: { File: '{{.*}}ptr-count-assignment-const-O0.c',
97-
// OPT-REM-NEXT: Line: 11, Column: 11 }
97+
// OPT-REM-NEXT: Line: 11, Column: 24 }
9898
// OPT-REM-NEXT: Function: main
9999
// OPT-REM-NEXT: Args:
100100
// OPT-REM-NEXT: - String: 'Inserted '

clang/test/BoundsSafety/CodeGen/trap-reasons/ptr_ge_upper_bound-deref-array_subscript-O0.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ int operation(int index) {
6161

6262
// CHECK-DAG: [[TRAP_LOC:![0-9]+]] = !DILocation(line: 0, scope: [[TRAP_SCOPE]], inlinedAt: [[SRC_LOC:![0-9]+]])
6363
// PLAIN-DAG: [[SRC_LOC]] = !DILocation(line: 49, column: 10, scope: {{![0-9]+}})
64-
// MACRO-DAG: [[SRC_LOC]] = !DILocation(line: 51, column: 10, scope: {{![0-9]+}})
64+
// MACRO-DAG: [[SRC_LOC]] = !DILocation(line: 51, column: 16, scope: {{![0-9]+}})
6565

6666
// In the detailed mode the address space overflow gets its own trap reason.
6767
// FIXME: Basic mode should probably be making this distinction too.

clang/test/BoundsSafety/CodeGen/trap-reasons/ptr_lt_lower_bound-deref-array_subscript-O0.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ int operation(int index) {
4949
// DETAILED-DAG: [[TRAP_SCOPE]] = distinct !DISubprogram(name: "__clang_trap_msg$Bounds check failed$indexing below lower bound in 'array[index]'", scope: [[FILE_SCOPE:![0-9]+]], file: [[FILE_SCOPE]], type: {{.+}}, flags: DIFlagArtificial, spFlags: DISPFlagDefinition, unit: {{![0-9]+}}
5050

5151
// PLAIN-DAG: [[LOC]] = !DILocation(line: 32, column: 10, scope: {{![0-9]+}})
52-
// MACRO-DAG: [[LOC]] = !DILocation(line: 34, column: 10, scope: {{![0-9]+}})
52+
// MACRO-DAG: [[LOC]] = !DILocation(line: 34, column: 16, scope: {{![0-9]+}})

0 commit comments

Comments
 (0)