https://github.com/fmayer updated https://github.com/llvm/llvm-project/pull/128976
>From 1903289d8fc62619f107094c9cb8b1dbccc09f91 Mon Sep 17 00:00:00 2001 From: Florian Mayer <fma...@google.com> Date: Wed, 26 Feb 2025 16:59:52 -0800 Subject: [PATCH 1/3] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?UTF-8?q?itial=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Created using spr 1.3.4 --- .../test/CodeGen/bounds-checking-debuginfo.c | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 clang/test/CodeGen/bounds-checking-debuginfo.c diff --git a/clang/test/CodeGen/bounds-checking-debuginfo.c b/clang/test/CodeGen/bounds-checking-debuginfo.c new file mode 100644 index 0000000000000..16802f57938e7 --- /dev/null +++ b/clang/test/CodeGen/bounds-checking-debuginfo.c @@ -0,0 +1,118 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5 +// RUN: %clang_cc1 -emit-llvm -fsanitize=array-bounds -fsanitize-trap=array-bounds -triple x86_64 -debug-info-kind=standalone %s -o - | FileCheck --check-prefix=CHECK-TRAP +// RUN: %clang_cc1 -emit-llvm -fsanitize=array-bounds -triple x86_64 -debug-info-kind=standalone %s -o - | FileCheck --check-prefix=CHECK-NOTRAP + + +int f(); +void d(double*); + +// CHECK-LABEL: @f1 +// CHECK-TRAP-LABEL: define dso_local double @f1( +// CHECK-TRAP-SAME: i32 noundef [[B:%.*]], i32 noundef [[I:%.*]]) #[[ATTR0:[0-9]+]] !dbg [[DBG5:![0-9]+]] { +// CHECK-TRAP-NEXT: [[ENTRY:.*:]] +// CHECK-TRAP-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4 +// CHECK-TRAP-NEXT: [[I_ADDR:%.*]] = alloca i32, align 4 +// CHECK-TRAP-NEXT: [[A:%.*]] = alloca [10 x double], align 16 +// CHECK-TRAP-NEXT: store i32 [[B]], ptr [[B_ADDR]], align 4 +// CHECK-TRAP-NEXT: #dbg_declare(ptr [[B_ADDR]], [[META12:![0-9]+]], !DIExpression(), [[META13:![0-9]+]]) +// CHECK-TRAP-NEXT: store i32 [[I]], ptr [[I_ADDR]], align 4 +// CHECK-TRAP-NEXT: #dbg_declare(ptr [[I_ADDR]], [[META14:![0-9]+]], !DIExpression(), [[META15:![0-9]+]]) +// CHECK-TRAP-NEXT: #dbg_declare(ptr [[A]], [[META16:![0-9]+]], !DIExpression(), [[META20:![0-9]+]]) +// CHECK-TRAP-NEXT: [[ARRAYDECAY:%.*]] = getelementptr inbounds [10 x double], ptr [[A]], i64 0, i64 0, !dbg [[DBG21:![0-9]+]] +// CHECK-TRAP-NEXT: call void @d(ptr noundef [[ARRAYDECAY]]), !dbg [[DBG22:![0-9]+]] +// CHECK-TRAP-NEXT: [[CALL:%.*]] = call i32 (...) @f(), !dbg [[DBG23:![0-9]+]] +// CHECK-TRAP-NEXT: [[TMP0:%.*]] = sext i32 [[CALL]] to i64, !dbg [[DBG24:![0-9]+]], !nosanitize [[META11:![0-9]+]] +// CHECK-TRAP-NEXT: [[TMP1:%.*]] = icmp ult i64 [[TMP0]], 10, !dbg [[DBG24]], !nosanitize [[META11]] +// CHECK-TRAP-NEXT: br i1 [[TMP1]], label %[[CONT:.*]], label %[[TRAP:.*]], !dbg [[DBG24]], !nosanitize [[META11]] +// CHECK-TRAP: [[TRAP]]: +// CHECK-TRAP-NEXT: call void @llvm.ubsantrap(i8 18) #[[ATTR3:[0-9]+]], !dbg [[DBG24]], !nosanitize [[META11]] +// CHECK-TRAP-NEXT: unreachable, !dbg [[DBG24]], !nosanitize [[META11]] +// CHECK-TRAP: [[CONT]]: +// CHECK-TRAP-NEXT: [[IDXPROM:%.*]] = sext i32 [[CALL]] to i64, !dbg [[DBG24]] +// CHECK-TRAP-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [10 x double], ptr [[A]], i64 0, i64 [[IDXPROM]], !dbg [[DBG24]] +// CHECK-TRAP-NEXT: [[TMP2:%.*]] = load double, ptr [[ARRAYIDX]], align 8, !dbg [[DBG24]] +// CHECK-TRAP-NEXT: ret double [[TMP2]], !dbg [[DBG25:![0-9]+]] +// +// CHECK-NOTRAP-LABEL: define dso_local double @f1( +// CHECK-NOTRAP-SAME: i32 noundef [[B:%.*]], i32 noundef [[I:%.*]]) #[[ATTR0:[0-9]+]] !dbg [[DBG5:![0-9]+]] { +// CHECK-NOTRAP-NEXT: [[ENTRY:.*:]] +// CHECK-NOTRAP-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4 +// CHECK-NOTRAP-NEXT: [[I_ADDR:%.*]] = alloca i32, align 4 +// CHECK-NOTRAP-NEXT: [[A:%.*]] = alloca [10 x double], align 16 +// CHECK-NOTRAP-NEXT: store i32 [[B]], ptr [[B_ADDR]], align 4 +// CHECK-NOTRAP-NEXT: #dbg_declare(ptr [[B_ADDR]], [[META12:![0-9]+]], !DIExpression(), [[META13:![0-9]+]]) +// CHECK-NOTRAP-NEXT: store i32 [[I]], ptr [[I_ADDR]], align 4 +// CHECK-NOTRAP-NEXT: #dbg_declare(ptr [[I_ADDR]], [[META14:![0-9]+]], !DIExpression(), [[META15:![0-9]+]]) +// CHECK-NOTRAP-NEXT: #dbg_declare(ptr [[A]], [[META16:![0-9]+]], !DIExpression(), [[META20:![0-9]+]]) +// CHECK-NOTRAP-NEXT: [[ARRAYDECAY:%.*]] = getelementptr inbounds [10 x double], ptr [[A]], i64 0, i64 0, !dbg [[DBG21:![0-9]+]] +// CHECK-NOTRAP-NEXT: call void @d(ptr noundef [[ARRAYDECAY]]), !dbg [[DBG22:![0-9]+]] +// CHECK-NOTRAP-NEXT: [[CALL:%.*]] = call i32 (...) @f(), !dbg [[DBG23:![0-9]+]] +// CHECK-NOTRAP-NEXT: [[TMP0:%.*]] = sext i32 [[CALL]] to i64, !dbg [[DBG24:![0-9]+]], !nosanitize [[META11:![0-9]+]] +// CHECK-NOTRAP-NEXT: [[TMP1:%.*]] = icmp ult i64 [[TMP0]], 10, !dbg [[DBG24]], !nosanitize [[META11]] +// CHECK-NOTRAP-NEXT: br i1 [[TMP1]], label %[[CONT:.*]], label %[[HANDLER_OUT_OF_BOUNDS:.*]], !dbg [[DBG24]], !prof [[PROF25:![0-9]+]], !nosanitize [[META11]] +// CHECK-NOTRAP: [[HANDLER_OUT_OF_BOUNDS]]: +// CHECK-NOTRAP-NEXT: [[TMP2:%.*]] = zext i32 [[CALL]] to i64, !dbg [[DBG24]], !nosanitize [[META11]] +// CHECK-NOTRAP-NEXT: call void @__ubsan_handle_out_of_bounds_abort(ptr @[[GLOB2:[0-9]+]], i64 [[TMP2]]) #[[ATTR3:[0-9]+]], !dbg [[DBG24]], !nosanitize [[META11]] +// CHECK-NOTRAP-NEXT: unreachable, !dbg [[DBG24]], !nosanitize [[META11]] +// CHECK-NOTRAP: [[CONT]]: +// CHECK-NOTRAP-NEXT: [[IDXPROM:%.*]] = sext i32 [[CALL]] to i64, !dbg [[DBG24]] +// CHECK-NOTRAP-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [10 x double], ptr [[A]], i64 0, i64 [[IDXPROM]], !dbg [[DBG24]] +// CHECK-NOTRAP-NEXT: [[TMP3:%.*]] = load double, ptr [[ARRAYIDX]], align 8, !dbg [[DBG24]] +// CHECK-NOTRAP-NEXT: ret double [[TMP3]], !dbg [[DBG26:![0-9]+]] +// +double f1(int b, int i) { + double a[10]; + d(a); + return a[f()]; +} + +//. +// CHECK-TRAP: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C11, file: [[META1:![0-9]+]], producer: "{{.*}}clang version {{.*}}", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None) +// CHECK-TRAP: [[META1]] = !DIFile(filename: "clang/test/CodeGen/<stdin>", directory: {{.*}}) +// CHECK-TRAP: [[DBG5]] = distinct !DISubprogram(name: "f1", scope: [[META6:![0-9]+]], file: [[META6]], line: 62, type: [[META7:![0-9]+]], scopeLine: 62, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: [[META0]], retainedNodes: [[META11]]) +// CHECK-TRAP: [[META6]] = !DIFile(filename: "clang/test/CodeGen/bounds-checking-debuginfo.c", directory: {{.*}}) +// CHECK-TRAP: [[META7]] = !DISubroutineType(types: [[META8:![0-9]+]]) +// CHECK-TRAP: [[META8]] = !{[[META9:![0-9]+]], [[META10:![0-9]+]], [[META10]]} +// CHECK-TRAP: [[META9]] = !DIBasicType(name: "double", size: 64, encoding: DW_ATE_float) +// CHECK-TRAP: [[META10]] = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK-TRAP: [[META11]] = !{} +// CHECK-TRAP: [[META12]] = !DILocalVariable(name: "b", arg: 1, scope: [[DBG5]], file: [[META6]], line: 62, type: [[META10]]) +// CHECK-TRAP: [[META13]] = !DILocation(line: 62, column: 15, scope: [[DBG5]]) +// CHECK-TRAP: [[META14]] = !DILocalVariable(name: "i", arg: 2, scope: [[DBG5]], file: [[META6]], line: 62, type: [[META10]]) +// CHECK-TRAP: [[META15]] = !DILocation(line: 62, column: 22, scope: [[DBG5]]) +// CHECK-TRAP: [[META16]] = !DILocalVariable(name: "a", scope: [[DBG5]], file: [[META6]], line: 63, type: [[META17:![0-9]+]]) +// CHECK-TRAP: [[META17]] = !DICompositeType(tag: DW_TAG_array_type, baseType: [[META9]], size: 640, elements: [[META18:![0-9]+]]) +// CHECK-TRAP: [[META18]] = !{[[META19:![0-9]+]]} +// CHECK-TRAP: [[META19]] = !DISubrange(count: 10) +// CHECK-TRAP: [[META20]] = !DILocation(line: 63, column: 10, scope: [[DBG5]]) +// CHECK-TRAP: [[DBG21]] = !DILocation(line: 64, column: 5, scope: [[DBG5]]) +// CHECK-TRAP: [[DBG22]] = !DILocation(line: 64, column: 3, scope: [[DBG5]]) +// CHECK-TRAP: [[DBG23]] = !DILocation(line: 65, column: 12, scope: [[DBG5]]) +// CHECK-TRAP: [[DBG24]] = !DILocation(line: 65, column: 10, scope: [[DBG5]]) +// CHECK-TRAP: [[DBG25]] = !DILocation(line: 65, column: 3, scope: [[DBG5]]) +//. +// CHECK-NOTRAP: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C11, file: [[META1:![0-9]+]], producer: "{{.*}}clang version {{.*}}", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None) +// CHECK-NOTRAP: [[META1]] = !DIFile(filename: "clang/test/CodeGen/<stdin>", directory: {{.*}}) +// CHECK-NOTRAP: [[DBG5]] = distinct !DISubprogram(name: "f1", scope: [[META6:![0-9]+]], file: [[META6]], line: 62, type: [[META7:![0-9]+]], scopeLine: 62, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: [[META0]], retainedNodes: [[META11]]) +// CHECK-NOTRAP: [[META6]] = !DIFile(filename: "clang/test/CodeGen/bounds-checking-debuginfo.c", directory: {{.*}}) +// CHECK-NOTRAP: [[META7]] = !DISubroutineType(types: [[META8:![0-9]+]]) +// CHECK-NOTRAP: [[META8]] = !{[[META9:![0-9]+]], [[META10:![0-9]+]], [[META10]]} +// CHECK-NOTRAP: [[META9]] = !DIBasicType(name: "double", size: 64, encoding: DW_ATE_float) +// CHECK-NOTRAP: [[META10]] = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK-NOTRAP: [[META11]] = !{} +// CHECK-NOTRAP: [[META12]] = !DILocalVariable(name: "b", arg: 1, scope: [[DBG5]], file: [[META6]], line: 62, type: [[META10]]) +// CHECK-NOTRAP: [[META13]] = !DILocation(line: 62, column: 15, scope: [[DBG5]]) +// CHECK-NOTRAP: [[META14]] = !DILocalVariable(name: "i", arg: 2, scope: [[DBG5]], file: [[META6]], line: 62, type: [[META10]]) +// CHECK-NOTRAP: [[META15]] = !DILocation(line: 62, column: 22, scope: [[DBG5]]) +// CHECK-NOTRAP: [[META16]] = !DILocalVariable(name: "a", scope: [[DBG5]], file: [[META6]], line: 63, type: [[META17:![0-9]+]]) +// CHECK-NOTRAP: [[META17]] = !DICompositeType(tag: DW_TAG_array_type, baseType: [[META9]], size: 640, elements: [[META18:![0-9]+]]) +// CHECK-NOTRAP: [[META18]] = !{[[META19:![0-9]+]]} +// CHECK-NOTRAP: [[META19]] = !DISubrange(count: 10) +// CHECK-NOTRAP: [[META20]] = !DILocation(line: 63, column: 10, scope: [[DBG5]]) +// CHECK-NOTRAP: [[DBG21]] = !DILocation(line: 64, column: 5, scope: [[DBG5]]) +// CHECK-NOTRAP: [[DBG22]] = !DILocation(line: 64, column: 3, scope: [[DBG5]]) +// CHECK-NOTRAP: [[DBG23]] = !DILocation(line: 65, column: 12, scope: [[DBG5]]) +// CHECK-NOTRAP: [[DBG24]] = !DILocation(line: 65, column: 10, scope: [[DBG5]]) +// CHECK-NOTRAP: [[PROF25]] = !{!"branch_weights", i32 1048575, i32 1} +// CHECK-NOTRAP: [[DBG26]] = !DILocation(line: 65, column: 3, scope: [[DBG5]]) +//. >From 3bf1aced33359273f57c5f845e5e27834abfab19 Mon Sep 17 00:00:00 2001 From: Florian Mayer <fma...@google.com> Date: Wed, 26 Feb 2025 17:04:16 -0800 Subject: [PATCH 2/3] update Created using spr 1.3.4 --- .../test/CodeGen/bounds-checking-debuginfo.c | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/clang/test/CodeGen/bounds-checking-debuginfo.c b/clang/test/CodeGen/bounds-checking-debuginfo.c index 16802f57938e7..19683ea6cfd1a 100644 --- a/clang/test/CodeGen/bounds-checking-debuginfo.c +++ b/clang/test/CodeGen/bounds-checking-debuginfo.c @@ -69,50 +69,50 @@ double f1(int b, int i) { //. // CHECK-TRAP: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C11, file: [[META1:![0-9]+]], producer: "{{.*}}clang version {{.*}}", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None) // CHECK-TRAP: [[META1]] = !DIFile(filename: "clang/test/CodeGen/<stdin>", directory: {{.*}}) -// CHECK-TRAP: [[DBG5]] = distinct !DISubprogram(name: "f1", scope: [[META6:![0-9]+]], file: [[META6]], line: 62, type: [[META7:![0-9]+]], scopeLine: 62, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: [[META0]], retainedNodes: [[META11]]) +// CHECK-TRAP: [[DBG5]] = distinct !DISubprogram(name: "f1", scope: [[META6:![0-9]+]], file: [[META6]], line: 63, type: [[META7:![0-9]+]], scopeLine: 63, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: [[META0]], retainedNodes: [[META11]]) // CHECK-TRAP: [[META6]] = !DIFile(filename: "clang/test/CodeGen/bounds-checking-debuginfo.c", directory: {{.*}}) // CHECK-TRAP: [[META7]] = !DISubroutineType(types: [[META8:![0-9]+]]) // CHECK-TRAP: [[META8]] = !{[[META9:![0-9]+]], [[META10:![0-9]+]], [[META10]]} // CHECK-TRAP: [[META9]] = !DIBasicType(name: "double", size: 64, encoding: DW_ATE_float) // CHECK-TRAP: [[META10]] = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) // CHECK-TRAP: [[META11]] = !{} -// CHECK-TRAP: [[META12]] = !DILocalVariable(name: "b", arg: 1, scope: [[DBG5]], file: [[META6]], line: 62, type: [[META10]]) -// CHECK-TRAP: [[META13]] = !DILocation(line: 62, column: 15, scope: [[DBG5]]) -// CHECK-TRAP: [[META14]] = !DILocalVariable(name: "i", arg: 2, scope: [[DBG5]], file: [[META6]], line: 62, type: [[META10]]) -// CHECK-TRAP: [[META15]] = !DILocation(line: 62, column: 22, scope: [[DBG5]]) -// CHECK-TRAP: [[META16]] = !DILocalVariable(name: "a", scope: [[DBG5]], file: [[META6]], line: 63, type: [[META17:![0-9]+]]) +// CHECK-TRAP: [[META12]] = !DILocalVariable(name: "b", arg: 1, scope: [[DBG5]], file: [[META6]], line: 63, type: [[META10]]) +// CHECK-TRAP: [[META13]] = !DILocation(line: 63, column: 15, scope: [[DBG5]]) +// CHECK-TRAP: [[META14]] = !DILocalVariable(name: "i", arg: 2, scope: [[DBG5]], file: [[META6]], line: 63, type: [[META10]]) +// CHECK-TRAP: [[META15]] = !DILocation(line: 63, column: 22, scope: [[DBG5]]) +// CHECK-TRAP: [[META16]] = !DILocalVariable(name: "a", scope: [[DBG5]], file: [[META6]], line: 64, type: [[META17:![0-9]+]]) // CHECK-TRAP: [[META17]] = !DICompositeType(tag: DW_TAG_array_type, baseType: [[META9]], size: 640, elements: [[META18:![0-9]+]]) // CHECK-TRAP: [[META18]] = !{[[META19:![0-9]+]]} // CHECK-TRAP: [[META19]] = !DISubrange(count: 10) -// CHECK-TRAP: [[META20]] = !DILocation(line: 63, column: 10, scope: [[DBG5]]) -// CHECK-TRAP: [[DBG21]] = !DILocation(line: 64, column: 5, scope: [[DBG5]]) -// CHECK-TRAP: [[DBG22]] = !DILocation(line: 64, column: 3, scope: [[DBG5]]) -// CHECK-TRAP: [[DBG23]] = !DILocation(line: 65, column: 12, scope: [[DBG5]]) -// CHECK-TRAP: [[DBG24]] = !DILocation(line: 65, column: 10, scope: [[DBG5]]) -// CHECK-TRAP: [[DBG25]] = !DILocation(line: 65, column: 3, scope: [[DBG5]]) +// CHECK-TRAP: [[META20]] = !DILocation(line: 64, column: 10, scope: [[DBG5]]) +// CHECK-TRAP: [[DBG21]] = !DILocation(line: 65, column: 5, scope: [[DBG5]]) +// CHECK-TRAP: [[DBG22]] = !DILocation(line: 65, column: 3, scope: [[DBG5]]) +// CHECK-TRAP: [[DBG23]] = !DILocation(line: 66, column: 12, scope: [[DBG5]]) +// CHECK-TRAP: [[DBG24]] = !DILocation(line: 66, column: 10, scope: [[DBG5]]) +// CHECK-TRAP: [[DBG25]] = !DILocation(line: 66, column: 3, scope: [[DBG5]]) //. // CHECK-NOTRAP: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C11, file: [[META1:![0-9]+]], producer: "{{.*}}clang version {{.*}}", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None) // CHECK-NOTRAP: [[META1]] = !DIFile(filename: "clang/test/CodeGen/<stdin>", directory: {{.*}}) -// CHECK-NOTRAP: [[DBG5]] = distinct !DISubprogram(name: "f1", scope: [[META6:![0-9]+]], file: [[META6]], line: 62, type: [[META7:![0-9]+]], scopeLine: 62, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: [[META0]], retainedNodes: [[META11]]) +// CHECK-NOTRAP: [[DBG5]] = distinct !DISubprogram(name: "f1", scope: [[META6:![0-9]+]], file: [[META6]], line: 63, type: [[META7:![0-9]+]], scopeLine: 63, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: [[META0]], retainedNodes: [[META11]]) // CHECK-NOTRAP: [[META6]] = !DIFile(filename: "clang/test/CodeGen/bounds-checking-debuginfo.c", directory: {{.*}}) // CHECK-NOTRAP: [[META7]] = !DISubroutineType(types: [[META8:![0-9]+]]) // CHECK-NOTRAP: [[META8]] = !{[[META9:![0-9]+]], [[META10:![0-9]+]], [[META10]]} // CHECK-NOTRAP: [[META9]] = !DIBasicType(name: "double", size: 64, encoding: DW_ATE_float) // CHECK-NOTRAP: [[META10]] = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) // CHECK-NOTRAP: [[META11]] = !{} -// CHECK-NOTRAP: [[META12]] = !DILocalVariable(name: "b", arg: 1, scope: [[DBG5]], file: [[META6]], line: 62, type: [[META10]]) -// CHECK-NOTRAP: [[META13]] = !DILocation(line: 62, column: 15, scope: [[DBG5]]) -// CHECK-NOTRAP: [[META14]] = !DILocalVariable(name: "i", arg: 2, scope: [[DBG5]], file: [[META6]], line: 62, type: [[META10]]) -// CHECK-NOTRAP: [[META15]] = !DILocation(line: 62, column: 22, scope: [[DBG5]]) -// CHECK-NOTRAP: [[META16]] = !DILocalVariable(name: "a", scope: [[DBG5]], file: [[META6]], line: 63, type: [[META17:![0-9]+]]) +// CHECK-NOTRAP: [[META12]] = !DILocalVariable(name: "b", arg: 1, scope: [[DBG5]], file: [[META6]], line: 63, type: [[META10]]) +// CHECK-NOTRAP: [[META13]] = !DILocation(line: 63, column: 15, scope: [[DBG5]]) +// CHECK-NOTRAP: [[META14]] = !DILocalVariable(name: "i", arg: 2, scope: [[DBG5]], file: [[META6]], line: 63, type: [[META10]]) +// CHECK-NOTRAP: [[META15]] = !DILocation(line: 63, column: 22, scope: [[DBG5]]) +// CHECK-NOTRAP: [[META16]] = !DILocalVariable(name: "a", scope: [[DBG5]], file: [[META6]], line: 64, type: [[META17:![0-9]+]]) // CHECK-NOTRAP: [[META17]] = !DICompositeType(tag: DW_TAG_array_type, baseType: [[META9]], size: 640, elements: [[META18:![0-9]+]]) // CHECK-NOTRAP: [[META18]] = !{[[META19:![0-9]+]]} // CHECK-NOTRAP: [[META19]] = !DISubrange(count: 10) -// CHECK-NOTRAP: [[META20]] = !DILocation(line: 63, column: 10, scope: [[DBG5]]) -// CHECK-NOTRAP: [[DBG21]] = !DILocation(line: 64, column: 5, scope: [[DBG5]]) -// CHECK-NOTRAP: [[DBG22]] = !DILocation(line: 64, column: 3, scope: [[DBG5]]) -// CHECK-NOTRAP: [[DBG23]] = !DILocation(line: 65, column: 12, scope: [[DBG5]]) -// CHECK-NOTRAP: [[DBG24]] = !DILocation(line: 65, column: 10, scope: [[DBG5]]) +// CHECK-NOTRAP: [[META20]] = !DILocation(line: 64, column: 10, scope: [[DBG5]]) +// CHECK-NOTRAP: [[DBG21]] = !DILocation(line: 65, column: 5, scope: [[DBG5]]) +// CHECK-NOTRAP: [[DBG22]] = !DILocation(line: 65, column: 3, scope: [[DBG5]]) +// CHECK-NOTRAP: [[DBG23]] = !DILocation(line: 66, column: 12, scope: [[DBG5]]) +// CHECK-NOTRAP: [[DBG24]] = !DILocation(line: 66, column: 10, scope: [[DBG5]]) // CHECK-NOTRAP: [[PROF25]] = !{!"branch_weights", i32 1048575, i32 1} -// CHECK-NOTRAP: [[DBG26]] = !DILocation(line: 65, column: 3, scope: [[DBG5]]) +// CHECK-NOTRAP: [[DBG26]] = !DILocation(line: 66, column: 3, scope: [[DBG5]]) //. >From aeb2d1233bcbe6d936bb1fd152261602945dbbd7 Mon Sep 17 00:00:00 2001 From: Florian Mayer <fma...@google.com> Date: Thu, 27 Feb 2025 11:21:18 -0800 Subject: [PATCH 3/3] relative dirs Created using spr 1.3.4 --- .../test/CodeGen/bounds-checking-debuginfo.c | 160 +++++++++--------- 1 file changed, 80 insertions(+), 80 deletions(-) diff --git a/clang/test/CodeGen/bounds-checking-debuginfo.c b/clang/test/CodeGen/bounds-checking-debuginfo.c index 19683ea6cfd1a..9f9d2eb1901c2 100644 --- a/clang/test/CodeGen/bounds-checking-debuginfo.c +++ b/clang/test/CodeGen/bounds-checking-debuginfo.c @@ -1,6 +1,6 @@ // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5 -// RUN: %clang_cc1 -emit-llvm -fsanitize=array-bounds -fsanitize-trap=array-bounds -triple x86_64 -debug-info-kind=standalone %s -o - | FileCheck --check-prefix=CHECK-TRAP -// RUN: %clang_cc1 -emit-llvm -fsanitize=array-bounds -triple x86_64 -debug-info-kind=standalone %s -o - | FileCheck --check-prefix=CHECK-NOTRAP +// RUN: %clang_cc1 -emit-llvm -fdebug-prefix-map=%S=clang/test/CodeGen -fno-ident -fdebug-compilation-dir=%S -fsanitize=array-bounds -fsanitize-trap=array-bounds -triple x86_64 -debug-info-kind=limited %s -o - | FileCheck --check-prefix=CHECK-TRAP %s +// RUN: %clang_cc1 -emit-llvm -fdebug-prefix-map=%S=clang/test/CodeGen -fno-ident -fdebug-compilation-dir=%S -fsanitize=array-bounds -triple x86_64 -debug-info-kind=limited %s -o - | FileCheck --check-prefix=CHECK-NOTRAP %s int f(); @@ -8,57 +8,57 @@ void d(double*); // CHECK-LABEL: @f1 // CHECK-TRAP-LABEL: define dso_local double @f1( -// CHECK-TRAP-SAME: i32 noundef [[B:%.*]], i32 noundef [[I:%.*]]) #[[ATTR0:[0-9]+]] !dbg [[DBG5:![0-9]+]] { +// CHECK-TRAP-SAME: i32 noundef [[B:%.*]], i32 noundef [[I:%.*]]) #[[ATTR0:[0-9]+]] !dbg [[DBG4:![0-9]+]] { // CHECK-TRAP-NEXT: [[ENTRY:.*:]] // CHECK-TRAP-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4 // CHECK-TRAP-NEXT: [[I_ADDR:%.*]] = alloca i32, align 4 // CHECK-TRAP-NEXT: [[A:%.*]] = alloca [10 x double], align 16 // CHECK-TRAP-NEXT: store i32 [[B]], ptr [[B_ADDR]], align 4 -// CHECK-TRAP-NEXT: #dbg_declare(ptr [[B_ADDR]], [[META12:![0-9]+]], !DIExpression(), [[META13:![0-9]+]]) +// CHECK-TRAP-NEXT: #dbg_declare(ptr [[B_ADDR]], [[META11:![0-9]+]], !DIExpression(), [[META12:![0-9]+]]) // CHECK-TRAP-NEXT: store i32 [[I]], ptr [[I_ADDR]], align 4 -// CHECK-TRAP-NEXT: #dbg_declare(ptr [[I_ADDR]], [[META14:![0-9]+]], !DIExpression(), [[META15:![0-9]+]]) -// CHECK-TRAP-NEXT: #dbg_declare(ptr [[A]], [[META16:![0-9]+]], !DIExpression(), [[META20:![0-9]+]]) -// CHECK-TRAP-NEXT: [[ARRAYDECAY:%.*]] = getelementptr inbounds [10 x double], ptr [[A]], i64 0, i64 0, !dbg [[DBG21:![0-9]+]] -// CHECK-TRAP-NEXT: call void @d(ptr noundef [[ARRAYDECAY]]), !dbg [[DBG22:![0-9]+]] -// CHECK-TRAP-NEXT: [[CALL:%.*]] = call i32 (...) @f(), !dbg [[DBG23:![0-9]+]] -// CHECK-TRAP-NEXT: [[TMP0:%.*]] = sext i32 [[CALL]] to i64, !dbg [[DBG24:![0-9]+]], !nosanitize [[META11:![0-9]+]] -// CHECK-TRAP-NEXT: [[TMP1:%.*]] = icmp ult i64 [[TMP0]], 10, !dbg [[DBG24]], !nosanitize [[META11]] -// CHECK-TRAP-NEXT: br i1 [[TMP1]], label %[[CONT:.*]], label %[[TRAP:.*]], !dbg [[DBG24]], !nosanitize [[META11]] +// CHECK-TRAP-NEXT: #dbg_declare(ptr [[I_ADDR]], [[META13:![0-9]+]], !DIExpression(), [[META14:![0-9]+]]) +// CHECK-TRAP-NEXT: #dbg_declare(ptr [[A]], [[META15:![0-9]+]], !DIExpression(), [[META19:![0-9]+]]) +// CHECK-TRAP-NEXT: [[ARRAYDECAY:%.*]] = getelementptr inbounds [10 x double], ptr [[A]], i64 0, i64 0, !dbg [[DBG20:![0-9]+]] +// CHECK-TRAP-NEXT: call void @d(ptr noundef [[ARRAYDECAY]]), !dbg [[DBG21:![0-9]+]] +// CHECK-TRAP-NEXT: [[CALL:%.*]] = call i32 (...) @f(), !dbg [[DBG22:![0-9]+]] +// CHECK-TRAP-NEXT: [[TMP0:%.*]] = sext i32 [[CALL]] to i64, !dbg [[DBG23:![0-9]+]], !nosanitize [[META10:![0-9]+]] +// CHECK-TRAP-NEXT: [[TMP1:%.*]] = icmp ult i64 [[TMP0]], 10, !dbg [[DBG23]], !nosanitize [[META10]] +// CHECK-TRAP-NEXT: br i1 [[TMP1]], label %[[CONT:.*]], label %[[TRAP:.*]], !dbg [[DBG23]], !nosanitize [[META10]] // CHECK-TRAP: [[TRAP]]: -// CHECK-TRAP-NEXT: call void @llvm.ubsantrap(i8 18) #[[ATTR3:[0-9]+]], !dbg [[DBG24]], !nosanitize [[META11]] -// CHECK-TRAP-NEXT: unreachable, !dbg [[DBG24]], !nosanitize [[META11]] +// CHECK-TRAP-NEXT: call void @llvm.ubsantrap(i8 18) #[[ATTR3:[0-9]+]], !dbg [[DBG23]], !nosanitize [[META10]] +// CHECK-TRAP-NEXT: unreachable, !dbg [[DBG23]], !nosanitize [[META10]] // CHECK-TRAP: [[CONT]]: -// CHECK-TRAP-NEXT: [[IDXPROM:%.*]] = sext i32 [[CALL]] to i64, !dbg [[DBG24]] -// CHECK-TRAP-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [10 x double], ptr [[A]], i64 0, i64 [[IDXPROM]], !dbg [[DBG24]] -// CHECK-TRAP-NEXT: [[TMP2:%.*]] = load double, ptr [[ARRAYIDX]], align 8, !dbg [[DBG24]] -// CHECK-TRAP-NEXT: ret double [[TMP2]], !dbg [[DBG25:![0-9]+]] +// CHECK-TRAP-NEXT: [[IDXPROM:%.*]] = sext i32 [[CALL]] to i64, !dbg [[DBG23]] +// CHECK-TRAP-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [10 x double], ptr [[A]], i64 0, i64 [[IDXPROM]], !dbg [[DBG23]] +// CHECK-TRAP-NEXT: [[TMP2:%.*]] = load double, ptr [[ARRAYIDX]], align 8, !dbg [[DBG23]] +// CHECK-TRAP-NEXT: ret double [[TMP2]], !dbg [[DBG24:![0-9]+]] // // CHECK-NOTRAP-LABEL: define dso_local double @f1( -// CHECK-NOTRAP-SAME: i32 noundef [[B:%.*]], i32 noundef [[I:%.*]]) #[[ATTR0:[0-9]+]] !dbg [[DBG5:![0-9]+]] { +// CHECK-NOTRAP-SAME: i32 noundef [[B:%.*]], i32 noundef [[I:%.*]]) #[[ATTR0:[0-9]+]] !dbg [[DBG4:![0-9]+]] { // CHECK-NOTRAP-NEXT: [[ENTRY:.*:]] // CHECK-NOTRAP-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4 // CHECK-NOTRAP-NEXT: [[I_ADDR:%.*]] = alloca i32, align 4 // CHECK-NOTRAP-NEXT: [[A:%.*]] = alloca [10 x double], align 16 // CHECK-NOTRAP-NEXT: store i32 [[B]], ptr [[B_ADDR]], align 4 -// CHECK-NOTRAP-NEXT: #dbg_declare(ptr [[B_ADDR]], [[META12:![0-9]+]], !DIExpression(), [[META13:![0-9]+]]) +// CHECK-NOTRAP-NEXT: #dbg_declare(ptr [[B_ADDR]], [[META11:![0-9]+]], !DIExpression(), [[META12:![0-9]+]]) // CHECK-NOTRAP-NEXT: store i32 [[I]], ptr [[I_ADDR]], align 4 -// CHECK-NOTRAP-NEXT: #dbg_declare(ptr [[I_ADDR]], [[META14:![0-9]+]], !DIExpression(), [[META15:![0-9]+]]) -// CHECK-NOTRAP-NEXT: #dbg_declare(ptr [[A]], [[META16:![0-9]+]], !DIExpression(), [[META20:![0-9]+]]) -// CHECK-NOTRAP-NEXT: [[ARRAYDECAY:%.*]] = getelementptr inbounds [10 x double], ptr [[A]], i64 0, i64 0, !dbg [[DBG21:![0-9]+]] -// CHECK-NOTRAP-NEXT: call void @d(ptr noundef [[ARRAYDECAY]]), !dbg [[DBG22:![0-9]+]] -// CHECK-NOTRAP-NEXT: [[CALL:%.*]] = call i32 (...) @f(), !dbg [[DBG23:![0-9]+]] -// CHECK-NOTRAP-NEXT: [[TMP0:%.*]] = sext i32 [[CALL]] to i64, !dbg [[DBG24:![0-9]+]], !nosanitize [[META11:![0-9]+]] -// CHECK-NOTRAP-NEXT: [[TMP1:%.*]] = icmp ult i64 [[TMP0]], 10, !dbg [[DBG24]], !nosanitize [[META11]] -// CHECK-NOTRAP-NEXT: br i1 [[TMP1]], label %[[CONT:.*]], label %[[HANDLER_OUT_OF_BOUNDS:.*]], !dbg [[DBG24]], !prof [[PROF25:![0-9]+]], !nosanitize [[META11]] +// CHECK-NOTRAP-NEXT: #dbg_declare(ptr [[I_ADDR]], [[META13:![0-9]+]], !DIExpression(), [[META14:![0-9]+]]) +// CHECK-NOTRAP-NEXT: #dbg_declare(ptr [[A]], [[META15:![0-9]+]], !DIExpression(), [[META19:![0-9]+]]) +// CHECK-NOTRAP-NEXT: [[ARRAYDECAY:%.*]] = getelementptr inbounds [10 x double], ptr [[A]], i64 0, i64 0, !dbg [[DBG20:![0-9]+]] +// CHECK-NOTRAP-NEXT: call void @d(ptr noundef [[ARRAYDECAY]]), !dbg [[DBG21:![0-9]+]] +// CHECK-NOTRAP-NEXT: [[CALL:%.*]] = call i32 (...) @f(), !dbg [[DBG22:![0-9]+]] +// CHECK-NOTRAP-NEXT: [[TMP0:%.*]] = sext i32 [[CALL]] to i64, !dbg [[DBG23:![0-9]+]], !nosanitize [[META10:![0-9]+]] +// CHECK-NOTRAP-NEXT: [[TMP1:%.*]] = icmp ult i64 [[TMP0]], 10, !dbg [[DBG23]], !nosanitize [[META10]] +// CHECK-NOTRAP-NEXT: br i1 [[TMP1]], label %[[CONT:.*]], label %[[HANDLER_OUT_OF_BOUNDS:.*]], !dbg [[DBG23]], !prof [[PROF24:![0-9]+]], !nosanitize [[META10]] // CHECK-NOTRAP: [[HANDLER_OUT_OF_BOUNDS]]: -// CHECK-NOTRAP-NEXT: [[TMP2:%.*]] = zext i32 [[CALL]] to i64, !dbg [[DBG24]], !nosanitize [[META11]] -// CHECK-NOTRAP-NEXT: call void @__ubsan_handle_out_of_bounds_abort(ptr @[[GLOB2:[0-9]+]], i64 [[TMP2]]) #[[ATTR3:[0-9]+]], !dbg [[DBG24]], !nosanitize [[META11]] -// CHECK-NOTRAP-NEXT: unreachable, !dbg [[DBG24]], !nosanitize [[META11]] +// CHECK-NOTRAP-NEXT: [[TMP2:%.*]] = zext i32 [[CALL]] to i64, !dbg [[DBG23]], !nosanitize [[META10]] +// CHECK-NOTRAP-NEXT: call void @__ubsan_handle_out_of_bounds_abort(ptr @[[GLOB2:[0-9]+]], i64 [[TMP2]]) #[[ATTR3:[0-9]+]], !dbg [[DBG23]], !nosanitize [[META10]] +// CHECK-NOTRAP-NEXT: unreachable, !dbg [[DBG23]], !nosanitize [[META10]] // CHECK-NOTRAP: [[CONT]]: -// CHECK-NOTRAP-NEXT: [[IDXPROM:%.*]] = sext i32 [[CALL]] to i64, !dbg [[DBG24]] -// CHECK-NOTRAP-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [10 x double], ptr [[A]], i64 0, i64 [[IDXPROM]], !dbg [[DBG24]] -// CHECK-NOTRAP-NEXT: [[TMP3:%.*]] = load double, ptr [[ARRAYIDX]], align 8, !dbg [[DBG24]] -// CHECK-NOTRAP-NEXT: ret double [[TMP3]], !dbg [[DBG26:![0-9]+]] +// CHECK-NOTRAP-NEXT: [[IDXPROM:%.*]] = sext i32 [[CALL]] to i64, !dbg [[DBG23]] +// CHECK-NOTRAP-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [10 x double], ptr [[A]], i64 0, i64 [[IDXPROM]], !dbg [[DBG23]] +// CHECK-NOTRAP-NEXT: [[TMP3:%.*]] = load double, ptr [[ARRAYIDX]], align 8, !dbg [[DBG23]] +// CHECK-NOTRAP-NEXT: ret double [[TMP3]], !dbg [[DBG25:![0-9]+]] // double f1(int b, int i) { double a[10]; @@ -67,52 +67,52 @@ double f1(int b, int i) { } //. -// CHECK-TRAP: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C11, file: [[META1:![0-9]+]], producer: "{{.*}}clang version {{.*}}", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None) +// CHECK-TRAP: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C11, file: [[META1:![0-9]+]], isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None) // CHECK-TRAP: [[META1]] = !DIFile(filename: "clang/test/CodeGen/<stdin>", directory: {{.*}}) -// CHECK-TRAP: [[DBG5]] = distinct !DISubprogram(name: "f1", scope: [[META6:![0-9]+]], file: [[META6]], line: 63, type: [[META7:![0-9]+]], scopeLine: 63, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: [[META0]], retainedNodes: [[META11]]) -// CHECK-TRAP: [[META6]] = !DIFile(filename: "clang/test/CodeGen/bounds-checking-debuginfo.c", directory: {{.*}}) -// CHECK-TRAP: [[META7]] = !DISubroutineType(types: [[META8:![0-9]+]]) -// CHECK-TRAP: [[META8]] = !{[[META9:![0-9]+]], [[META10:![0-9]+]], [[META10]]} -// CHECK-TRAP: [[META9]] = !DIBasicType(name: "double", size: 64, encoding: DW_ATE_float) -// CHECK-TRAP: [[META10]] = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK-TRAP: [[META11]] = !{} -// CHECK-TRAP: [[META12]] = !DILocalVariable(name: "b", arg: 1, scope: [[DBG5]], file: [[META6]], line: 63, type: [[META10]]) -// CHECK-TRAP: [[META13]] = !DILocation(line: 63, column: 15, scope: [[DBG5]]) -// CHECK-TRAP: [[META14]] = !DILocalVariable(name: "i", arg: 2, scope: [[DBG5]], file: [[META6]], line: 63, type: [[META10]]) -// CHECK-TRAP: [[META15]] = !DILocation(line: 63, column: 22, scope: [[DBG5]]) -// CHECK-TRAP: [[META16]] = !DILocalVariable(name: "a", scope: [[DBG5]], file: [[META6]], line: 64, type: [[META17:![0-9]+]]) -// CHECK-TRAP: [[META17]] = !DICompositeType(tag: DW_TAG_array_type, baseType: [[META9]], size: 640, elements: [[META18:![0-9]+]]) -// CHECK-TRAP: [[META18]] = !{[[META19:![0-9]+]]} -// CHECK-TRAP: [[META19]] = !DISubrange(count: 10) -// CHECK-TRAP: [[META20]] = !DILocation(line: 64, column: 10, scope: [[DBG5]]) -// CHECK-TRAP: [[DBG21]] = !DILocation(line: 65, column: 5, scope: [[DBG5]]) -// CHECK-TRAP: [[DBG22]] = !DILocation(line: 65, column: 3, scope: [[DBG5]]) -// CHECK-TRAP: [[DBG23]] = !DILocation(line: 66, column: 12, scope: [[DBG5]]) -// CHECK-TRAP: [[DBG24]] = !DILocation(line: 66, column: 10, scope: [[DBG5]]) -// CHECK-TRAP: [[DBG25]] = !DILocation(line: 66, column: 3, scope: [[DBG5]]) +// CHECK-TRAP: [[DBG4]] = distinct !DISubprogram(name: "f1", scope: [[META5:![0-9]+]], file: [[META5]], line: 63, type: [[META6:![0-9]+]], scopeLine: 63, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: [[META0]], retainedNodes: [[META10]]) +// CHECK-TRAP: [[META5]] = !DIFile(filename: "clang/test/CodeGen/bounds-checking-debuginfo.c", directory: {{.*}}) +// CHECK-TRAP: [[META6]] = !DISubroutineType(types: [[META7:![0-9]+]]) +// CHECK-TRAP: [[META7]] = !{[[META8:![0-9]+]], [[META9:![0-9]+]], [[META9]]} +// CHECK-TRAP: [[META8]] = !DIBasicType(name: "double", size: 64, encoding: DW_ATE_float) +// CHECK-TRAP: [[META9]] = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK-TRAP: [[META10]] = !{} +// CHECK-TRAP: [[META11]] = !DILocalVariable(name: "b", arg: 1, scope: [[DBG4]], file: [[META5]], line: 63, type: [[META9]]) +// CHECK-TRAP: [[META12]] = !DILocation(line: 63, column: 15, scope: [[DBG4]]) +// CHECK-TRAP: [[META13]] = !DILocalVariable(name: "i", arg: 2, scope: [[DBG4]], file: [[META5]], line: 63, type: [[META9]]) +// CHECK-TRAP: [[META14]] = !DILocation(line: 63, column: 22, scope: [[DBG4]]) +// CHECK-TRAP: [[META15]] = !DILocalVariable(name: "a", scope: [[DBG4]], file: [[META5]], line: 64, type: [[META16:![0-9]+]]) +// CHECK-TRAP: [[META16]] = !DICompositeType(tag: DW_TAG_array_type, baseType: [[META8]], size: 640, elements: [[META17:![0-9]+]]) +// CHECK-TRAP: [[META17]] = !{[[META18:![0-9]+]]} +// CHECK-TRAP: [[META18]] = !DISubrange(count: 10) +// CHECK-TRAP: [[META19]] = !DILocation(line: 64, column: 10, scope: [[DBG4]]) +// CHECK-TRAP: [[DBG20]] = !DILocation(line: 65, column: 5, scope: [[DBG4]]) +// CHECK-TRAP: [[DBG21]] = !DILocation(line: 65, column: 3, scope: [[DBG4]]) +// CHECK-TRAP: [[DBG22]] = !DILocation(line: 66, column: 12, scope: [[DBG4]]) +// CHECK-TRAP: [[DBG23]] = !DILocation(line: 66, column: 10, scope: [[DBG4]]) +// CHECK-TRAP: [[DBG24]] = !DILocation(line: 66, column: 3, scope: [[DBG4]]) //. -// CHECK-NOTRAP: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C11, file: [[META1:![0-9]+]], producer: "{{.*}}clang version {{.*}}", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None) +// CHECK-NOTRAP: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C11, file: [[META1:![0-9]+]], isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None) // CHECK-NOTRAP: [[META1]] = !DIFile(filename: "clang/test/CodeGen/<stdin>", directory: {{.*}}) -// CHECK-NOTRAP: [[DBG5]] = distinct !DISubprogram(name: "f1", scope: [[META6:![0-9]+]], file: [[META6]], line: 63, type: [[META7:![0-9]+]], scopeLine: 63, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: [[META0]], retainedNodes: [[META11]]) -// CHECK-NOTRAP: [[META6]] = !DIFile(filename: "clang/test/CodeGen/bounds-checking-debuginfo.c", directory: {{.*}}) -// CHECK-NOTRAP: [[META7]] = !DISubroutineType(types: [[META8:![0-9]+]]) -// CHECK-NOTRAP: [[META8]] = !{[[META9:![0-9]+]], [[META10:![0-9]+]], [[META10]]} -// CHECK-NOTRAP: [[META9]] = !DIBasicType(name: "double", size: 64, encoding: DW_ATE_float) -// CHECK-NOTRAP: [[META10]] = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK-NOTRAP: [[META11]] = !{} -// CHECK-NOTRAP: [[META12]] = !DILocalVariable(name: "b", arg: 1, scope: [[DBG5]], file: [[META6]], line: 63, type: [[META10]]) -// CHECK-NOTRAP: [[META13]] = !DILocation(line: 63, column: 15, scope: [[DBG5]]) -// CHECK-NOTRAP: [[META14]] = !DILocalVariable(name: "i", arg: 2, scope: [[DBG5]], file: [[META6]], line: 63, type: [[META10]]) -// CHECK-NOTRAP: [[META15]] = !DILocation(line: 63, column: 22, scope: [[DBG5]]) -// CHECK-NOTRAP: [[META16]] = !DILocalVariable(name: "a", scope: [[DBG5]], file: [[META6]], line: 64, type: [[META17:![0-9]+]]) -// CHECK-NOTRAP: [[META17]] = !DICompositeType(tag: DW_TAG_array_type, baseType: [[META9]], size: 640, elements: [[META18:![0-9]+]]) -// CHECK-NOTRAP: [[META18]] = !{[[META19:![0-9]+]]} -// CHECK-NOTRAP: [[META19]] = !DISubrange(count: 10) -// CHECK-NOTRAP: [[META20]] = !DILocation(line: 64, column: 10, scope: [[DBG5]]) -// CHECK-NOTRAP: [[DBG21]] = !DILocation(line: 65, column: 5, scope: [[DBG5]]) -// CHECK-NOTRAP: [[DBG22]] = !DILocation(line: 65, column: 3, scope: [[DBG5]]) -// CHECK-NOTRAP: [[DBG23]] = !DILocation(line: 66, column: 12, scope: [[DBG5]]) -// CHECK-NOTRAP: [[DBG24]] = !DILocation(line: 66, column: 10, scope: [[DBG5]]) -// CHECK-NOTRAP: [[PROF25]] = !{!"branch_weights", i32 1048575, i32 1} -// CHECK-NOTRAP: [[DBG26]] = !DILocation(line: 66, column: 3, scope: [[DBG5]]) +// CHECK-NOTRAP: [[DBG4]] = distinct !DISubprogram(name: "f1", scope: [[META5:![0-9]+]], file: [[META5]], line: 63, type: [[META6:![0-9]+]], scopeLine: 63, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: [[META0]], retainedNodes: [[META10]]) +// CHECK-NOTRAP: [[META5]] = !DIFile(filename: "clang/test/CodeGen/bounds-checking-debuginfo.c", directory: {{.*}}) +// CHECK-NOTRAP: [[META6]] = !DISubroutineType(types: [[META7:![0-9]+]]) +// CHECK-NOTRAP: [[META7]] = !{[[META8:![0-9]+]], [[META9:![0-9]+]], [[META9]]} +// CHECK-NOTRAP: [[META8]] = !DIBasicType(name: "double", size: 64, encoding: DW_ATE_float) +// CHECK-NOTRAP: [[META9]] = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK-NOTRAP: [[META10]] = !{} +// CHECK-NOTRAP: [[META11]] = !DILocalVariable(name: "b", arg: 1, scope: [[DBG4]], file: [[META5]], line: 63, type: [[META9]]) +// CHECK-NOTRAP: [[META12]] = !DILocation(line: 63, column: 15, scope: [[DBG4]]) +// CHECK-NOTRAP: [[META13]] = !DILocalVariable(name: "i", arg: 2, scope: [[DBG4]], file: [[META5]], line: 63, type: [[META9]]) +// CHECK-NOTRAP: [[META14]] = !DILocation(line: 63, column: 22, scope: [[DBG4]]) +// CHECK-NOTRAP: [[META15]] = !DILocalVariable(name: "a", scope: [[DBG4]], file: [[META5]], line: 64, type: [[META16:![0-9]+]]) +// CHECK-NOTRAP: [[META16]] = !DICompositeType(tag: DW_TAG_array_type, baseType: [[META8]], size: 640, elements: [[META17:![0-9]+]]) +// CHECK-NOTRAP: [[META17]] = !{[[META18:![0-9]+]]} +// CHECK-NOTRAP: [[META18]] = !DISubrange(count: 10) +// CHECK-NOTRAP: [[META19]] = !DILocation(line: 64, column: 10, scope: [[DBG4]]) +// CHECK-NOTRAP: [[DBG20]] = !DILocation(line: 65, column: 5, scope: [[DBG4]]) +// CHECK-NOTRAP: [[DBG21]] = !DILocation(line: 65, column: 3, scope: [[DBG4]]) +// CHECK-NOTRAP: [[DBG22]] = !DILocation(line: 66, column: 12, scope: [[DBG4]]) +// CHECK-NOTRAP: [[DBG23]] = !DILocation(line: 66, column: 10, scope: [[DBG4]]) +// CHECK-NOTRAP: [[PROF24]] = !{!"branch_weights", i32 1048575, i32 1} +// CHECK-NOTRAP: [[DBG25]] = !DILocation(line: 66, column: 3, scope: [[DBG4]]) //. _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits