diff options
Diffstat (limited to 'clang/test')
19 files changed, 65 insertions, 6 deletions
diff --git a/clang/test/CodeGen/debug-info-gline-tables-only.c b/clang/test/CodeGen/debug-info-gline-tables-only.c index e890dbb0da2..6f832be8287 100644 --- a/clang/test/CodeGen/debug-info-gline-tables-only.c +++ b/clang/test/CodeGen/debug-info-gline-tables-only.c @@ -1,5 +1,6 @@ // RUN: %clang_cc1 %s -debug-info-kind=line-tables-only -S -emit-llvm -o - | FileCheck %s -// Checks that clang with "-gline-tables-only" doesn't emit debug info +// RUN: %clang_cc1 %s -debug-info-kind=line-directives-only -S -emit-llvm -o - | FileCheck %s +// Checks that clang with "-gline-tables-only" or "-gline-directives-only" doesn't emit debug info // for variables and types. // CHECK-NOT: DW_TAG_variable diff --git a/clang/test/CodeGen/debug-info-gline-tables-only2.c b/clang/test/CodeGen/debug-info-gline-tables-only2.c index da17d41f3b1..8b8fbc2fe00 100644 --- a/clang/test/CodeGen/debug-info-gline-tables-only2.c +++ b/clang/test/CodeGen/debug-info-gline-tables-only2.c @@ -1,5 +1,6 @@ // RUN: %clang_cc1 %s -debug-info-kind=line-tables-only -S -emit-llvm -o - | FileCheck %s -// Checks that clang with "-gline-tables-only" emits metadata for +// RUN: %clang_cc1 %s -debug-info-kind=line-directives-only -S -emit-llvm -o - | FileCheck %s +// Checks that clang with "-gline-tables-only" or "-gline-directives-only" emits metadata for // compile unit, subprogram and file. int main() { diff --git a/clang/test/CodeGen/debug-info-line.c b/clang/test/CodeGen/debug-info-line.c index 24981b54b7e..39595d148c1 100644 --- a/clang/test/CodeGen/debug-info-line.c +++ b/clang/test/CodeGen/debug-info-line.c @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -w -debug-info-kind=line-tables-only -fexceptions -fcxx-exceptions -S -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -w -debug-info-kind=line-directives-only -fexceptions -fcxx-exceptions -S -emit-llvm %s -o - | FileCheck %s int f1(int a, int b) { // CHECK: icmp {{.*}}, !dbg [[DBG_F1:!.*]] diff --git a/clang/test/CodeGen/debug-info-macro.c b/clang/test/CodeGen/debug-info-macro.c index 7f7358d04bd..6294d43753f 100644 --- a/clang/test/CodeGen/debug-info-macro.c +++ b/clang/test/CodeGen/debug-info-macro.c @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -emit-llvm -debug-info-kind=line-tables-only -debug-info-macro %s -o - "-DC1(x)=( x + 5 )" -DA -include %S/Inputs/debug-info-macro.h -UC1 | FileCheck -check-prefixes=CHECK,NO_PCH %s +// RUN: %clang_cc1 -emit-llvm -debug-info-kind=line-directives-only -debug-info-macro %s -o - "-DC1(x)=( x + 5 )" -DA -include %S/Inputs/debug-info-macro.h -UC1 | FileCheck -check-prefixes=CHECK,NO_PCH %s // RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited -debug-info-macro %s -o - "-DC1(x)=( x + 5 )" -DA -include %S/Inputs/debug-info-macro.h -UC1 | FileCheck -check-prefixes=CHECK,NO_PCH %s // RUN: %clang_cc1 -emit-llvm -debug-info-kind=standalone -debug-info-macro %s -o - "-DC1(x)=( x + 5 )" -DA -include %S/Inputs/debug-info-macro.h -UC1 | FileCheck -check-prefixes=CHECK,NO_PCH %s // RUN: %clang_cc1 -emit-llvm -debug-info-macro %s -o - "-DC1(x)=( x + 5 )" -DA -include %S/Inputs/debug-info-macro.h -UC1 | FileCheck -check-prefixes=NO_MACRO %s diff --git a/clang/test/CodeGen/debug-info-scope.c b/clang/test/CodeGen/debug-info-scope.c index a25f1177a91..0c12c4d6046 100644 --- a/clang/test/CodeGen/debug-info-scope.c +++ b/clang/test/CodeGen/debug-info-scope.c @@ -1,5 +1,6 @@ // RUN: %clang_cc1 -dwarf-version=4 -debug-info-kind=limited -disable-llvm-passes -emit-llvm < %s | FileCheck %s // RUN: %clang_cc1 -dwarf-version=4 -debug-info-kind=line-tables-only -disable-llvm-passes -emit-llvm < %s | FileCheck --check-prefix=GMLT %s +// RUN: %clang_cc1 -dwarf-version=4 -debug-info-kind=line-directives-only -disable-llvm-passes -emit-llvm < %s | FileCheck --check-prefix=GMLT %s // Two variables with same name in separate scope. // Radar 8330217. int main() { diff --git a/clang/test/CodeGen/lifetime-debuginfo-1.c b/clang/test/CodeGen/lifetime-debuginfo-1.c index e2e45cb7f81..10fd2c21644 100644 --- a/clang/test/CodeGen/lifetime-debuginfo-1.c +++ b/clang/test/CodeGen/lifetime-debuginfo-1.c @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -O1 -triple x86_64-none-linux-gnu -emit-llvm -debug-info-kind=line-tables-only %s -o - | FileCheck %s +// RUN: %clang_cc1 -O1 -triple x86_64-none-linux-gnu -emit-llvm -debug-info-kind=line-directives-only %s -o - | FileCheck %s // Inserting lifetime markers should not affect debuginfo diff --git a/clang/test/CodeGen/lifetime-debuginfo-2.c b/clang/test/CodeGen/lifetime-debuginfo-2.c index 1d2fb595769..a2e06519358 100644 --- a/clang/test/CodeGen/lifetime-debuginfo-2.c +++ b/clang/test/CodeGen/lifetime-debuginfo-2.c @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -O1 -triple x86_64-none-linux-gnu -emit-llvm -debug-info-kind=line-tables-only %s -o - | FileCheck %s +// RUN: %clang_cc1 -O1 -triple x86_64-none-linux-gnu -emit-llvm -debug-info-kind=line-directives-only %s -o - | FileCheck %s // Inserting lifetime markers should not affect debuginfo: lifetime.end is not // a destructor, but instrumentation for the compiler. Ensure the debug info for diff --git a/clang/test/CodeGenCXX/crash.cpp b/clang/test/CodeGenCXX/crash.cpp index d12c021a6dc..63bca484b5d 100644 --- a/clang/test/CodeGenCXX/crash.cpp +++ b/clang/test/CodeGenCXX/crash.cpp @@ -1,5 +1,6 @@ // RUN: %clang_cc1 %s -std=c++11 -emit-llvm-only // RUN: %clang_cc1 -emit-obj -o %t -debug-info-kind=line-tables-only -std=c++11 %s +// RUN: %clang_cc1 -emit-obj -o %t -debug-info-kind=line-directives-only -std=c++11 %s // CHECK that we don't crash. // PR11676's example is ill-formed: diff --git a/clang/test/CodeGenCXX/debug-info-blocks.cpp b/clang/test/CodeGenCXX/debug-info-blocks.cpp index ed0d659eeae..fd2f0c99e77 100644 --- a/clang/test/CodeGenCXX/debug-info-blocks.cpp +++ b/clang/test/CodeGenCXX/debug-info-blocks.cpp @@ -1,4 +1,5 @@ // RUN: %clang_cc1 %s -debug-info-kind=line-tables-only -fblocks -S -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 %s -debug-info-kind=line-directives-only -fblocks -S -emit-llvm -o - | FileCheck %s struct A { A(); @@ -11,8 +12,8 @@ void test() { } // CHECK: !DISubprogram(name: "__Block_byref_object_copy_", -// CHECK-SAME: line: 10, +// CHECK-SAME: line: 11, // CHECK-SAME: isLocal: true, isDefinition: true // CHECK: !DISubprogram(name: "__Block_byref_object_dispose_", -// CHECK-SAME: line: 10, +// CHECK-SAME: line: 11, // CHECK-SAME: isLocal: true, isDefinition: true diff --git a/clang/test/CodeGenCXX/debug-info-gline-tables-only.cpp b/clang/test/CodeGenCXX/debug-info-gline-tables-only.cpp index d98b27872d6..ceb7856addc 100644 --- a/clang/test/CodeGenCXX/debug-info-gline-tables-only.cpp +++ b/clang/test/CodeGenCXX/debug-info-gline-tables-only.cpp @@ -1,5 +1,6 @@ // RUN: %clang_cc1 %s -fno-rtti -debug-info-kind=line-tables-only -S -emit-llvm -o - | FileCheck %s -// Checks that clang with "-gline-tables-only" doesn't emit debug info +// RUN: %clang_cc1 %s -fno-rtti -debug-info-kind=line-directives-only -S -emit-llvm -o - | FileCheck %s +// Checks that clang with "-gline-tables-only" or "-gline-directives-only" doesn't emit debug info // for variables and types. // CHECK-NOT: DW_TAG_namespace diff --git a/clang/test/CodeGenCXX/debug-info-line.cpp b/clang/test/CodeGenCXX/debug-info-line.cpp index a1c4ef9eea2..100cfa6e5e9 100644 --- a/clang/test/CodeGenCXX/debug-info-line.cpp +++ b/clang/test/CodeGenCXX/debug-info-line.cpp @@ -1,5 +1,7 @@ // RUN: %clang_cc1 -w -debug-info-kind=line-tables-only -std=c++11 -fexceptions -fcxx-exceptions -S -mllvm -no-discriminators -emit-llvm %s -o - -triple %itanium_abi_triple | FileCheck %s // RUN: %clang_cc1 -w -debug-info-kind=line-tables-only -std=c++11 -fexceptions -fcxx-exceptions -S -mllvm -no-discriminators -emit-llvm %s -o - -triple i686-linux-gnu | FileCheck %s +// RUN: %clang_cc1 -w -debug-info-kind=line-directives-only -std=c++11 -fexceptions -fcxx-exceptions -S -mllvm -no-discriminators -emit-llvm %s -o - -triple %itanium_abi_triple | FileCheck %s +// RUN: %clang_cc1 -w -debug-info-kind=line-directives-only -std=c++11 -fexceptions -fcxx-exceptions -S -mllvm -no-discriminators -emit-llvm %s -o - -triple i686-linux-gnu | FileCheck %s int &src(); int *sink(); diff --git a/clang/test/CodeGenCXX/debug-info-ms-dtor-thunks.cpp b/clang/test/CodeGenCXX/debug-info-ms-dtor-thunks.cpp index d6fdee62d67..88449c8d6b7 100644 --- a/clang/test/CodeGenCXX/debug-info-ms-dtor-thunks.cpp +++ b/clang/test/CodeGenCXX/debug-info-ms-dtor-thunks.cpp @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -triple i686--windows -emit-llvm -debug-info-kind=line-tables-only -x c++ %s -fms-extensions -o - | FileCheck %s +// RUN: %clang_cc1 -triple i686--windows -emit-llvm -debug-info-kind=line-directives-only -x c++ %s -fms-extensions -o - | FileCheck %s struct __declspec(dllexport) S { virtual ~S(); }; struct __declspec(dllexport) T { virtual ~T(); }; diff --git a/clang/test/CodeGenCXX/debug-info-namespace.cpp b/clang/test/CodeGenCXX/debug-info-namespace.cpp index 296c99efc8e..65896cce62f 100644 --- a/clang/test/CodeGenCXX/debug-info-namespace.cpp +++ b/clang/test/CodeGenCXX/debug-info-namespace.cpp @@ -1,5 +1,6 @@ // RUN: %clang_cc1 -std=c++11 -debug-info-kind=limited -S -emit-llvm %s -o - | FileCheck %s // RUN: %clang_cc1 -std=c++11 -debug-info-kind=line-tables-only -S -emit-llvm %s -o - | FileCheck -check-prefix=CHECK-GMLT %s +// RUN: %clang_cc1 -std=c++11 -debug-info-kind=line-directives-only -S -emit-llvm %s -o - | FileCheck -check-prefix=CHECK-GMLI %s // RUN: %clang_cc1 -std=c++11 -debug-info-kind=standalone -S -emit-llvm %s -o - | FileCheck -check-prefix=CHECK-NOLIMIT %s namespace A { @@ -125,6 +126,10 @@ void C::c() {} // CHECK-GMLT-SAME: emissionKind: LineTablesOnly, // CHECK-GMLT-NOT: imports: +// CHECK-GMLI: [[CU:![0-9]+]] = distinct !DICompileUnit( +// CHECK-GMLI-SAME: emissionKind: DebugDirectivesOnly, +// CHECK-GMLI-NOT: imports: + // CHECK-NOLIMIT: !DICompositeType(tag: DW_TAG_structure_type, name: "bar",{{.*}} line: 6, // CHECK-NOLIMIT-NOT: DIFlagFwdDecl // CHECK-NOLIMIT-SAME: ){{$}} diff --git a/clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp b/clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp index c8d8a1de855..cd51b522505 100644 --- a/clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp +++ b/clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp @@ -1,8 +1,9 @@ // RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -debug-info-kind=limited %s -o - | FileCheck %s -// Run again with -gline-tables-only and verify we don't crash. We won't output +// Run again with -gline-tables-only or -gline-directives-only and verify we don't crash. We won't output // type info at all. // RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -debug-info-kind=line-tables-only %s -o - | FileCheck %s -check-prefix LINES-ONLY +// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -debug-info-kind=line-directives-only %s -o - | FileCheck %s -check-prefix LINES-ONLY // LINES-ONLY-NOT: !DICompositeType(tag: DW_TAG_structure_type diff --git a/clang/test/CodeGenCXX/debug-info-windows-dtor.cpp b/clang/test/CodeGenCXX/debug-info-windows-dtor.cpp index 0b3d7e17e3f..beea56ce736 100644 --- a/clang/test/CodeGenCXX/debug-info-windows-dtor.cpp +++ b/clang/test/CodeGenCXX/debug-info-windows-dtor.cpp @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -triple i386-unknown-windows-msvc -std=c++11 -emit-llvm -debug-info-kind=line-tables-only %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple i386-unknown-windows-msvc -std=c++11 -emit-llvm -debug-info-kind=line-directives-only %s -o - | FileCheck %s struct A { virtual ~A() {} diff --git a/clang/test/CodeGenCXX/linetable-virtual-variadic.cpp b/clang/test/CodeGenCXX/linetable-virtual-variadic.cpp index cd746cdfdfe..60dee5fe61b 100644 --- a/clang/test/CodeGenCXX/linetable-virtual-variadic.cpp +++ b/clang/test/CodeGenCXX/linetable-virtual-variadic.cpp @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -debug-info-kind=line-tables-only %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -debug-info-kind=line-directives-only %s -o - | FileCheck %s // Crasher for PR22929. class Base { virtual void VariadicFunction(...); diff --git a/clang/test/CodeGenObjCXX/debug-info-line.mm b/clang/test/CodeGenObjCXX/debug-info-line.mm index 7cdb4d20fba..d1cfc5b0030 100644 --- a/clang/test/CodeGenObjCXX/debug-info-line.mm +++ b/clang/test/CodeGenObjCXX/debug-info-line.mm @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -triple x86_64-unknown-windows-gnu -fcxx-exceptions -fexceptions -debug-info-kind=line-tables-only -fblocks -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-unknown-windows-gnu -fcxx-exceptions -fexceptions -debug-info-kind=line-directives-only -fblocks -emit-llvm %s -o - | FileCheck %s void fn(); diff --git a/clang/test/CodeGenObjCXX/pr14474-gline-tables-only.mm b/clang/test/CodeGenObjCXX/pr14474-gline-tables-only.mm index 6c74ce80db0..cfc6d78b6b8 100644 --- a/clang/test/CodeGenObjCXX/pr14474-gline-tables-only.mm +++ b/clang/test/CodeGenObjCXX/pr14474-gline-tables-only.mm @@ -1,6 +1,8 @@ // PR 14474 // RUN: %clang_cc1 -triple i386-apple-macosx10.6.0 -emit-llvm \ // RUN: -debug-info-kind=line-tables-only -x objective-c++ -o /dev/null %s +// RUN: %clang_cc1 -triple i386-apple-macosx10.6.0 -emit-llvm \ +// RUN: -debug-info-kind=line-directives-only -x objective-c++ -o /dev/null %s typedef signed char BOOL; @class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator; diff --git a/clang/test/Driver/debug-options.c b/clang/test/Driver/debug-options.c index 0435d3ab590..04b9383c063 100644 --- a/clang/test/Driver/debug-options.c +++ b/clang/test/Driver/debug-options.c @@ -119,6 +119,25 @@ // RUN: %clang -### -c -gline-tables-only -g0 %s 2>&1 \ // RUN: | FileCheck -check-prefix=GLTO_NO %s // +// RUN: %clang -### -c -gline-directives-only %s -target x86_64-apple-darwin 2>&1 \ +// RUN: | FileCheck -check-prefix=GLIO_ONLY %s +// RUN: %clang -### -c -gline-directives-only %s -target i686-pc-openbsd 2>&1 \ +// RUN: | FileCheck -check-prefix=GLIO_ONLY_DWARF2 %s +// RUN: %clang -### -c -gline-directives-only %s -target x86_64-pc-freebsd10.0 2>&1 \ +// RUN: | FileCheck -check-prefix=GLIO_ONLY_DWARF2 %s +// RUN: %clang -### -c -gline-directives-only -g %s -target x86_64-linux-gnu 2>&1 \ +// RUN: | FileCheck -check-prefix=G_ONLY %s +// RUN: %clang -### -c -gline-directives-only -g %s -target x86_64-apple-darwin16 2>&1 \ +// RUN: | FileCheck -check-prefix=G_STANDALONE -check-prefix=G_DWARF4 %s +// RUN: %clang -### -c -gline-directives-only -g %s -target i686-pc-openbsd 2>&1 \ +// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s +// RUN: %clang -### -c -gline-directives-only -g %s -target x86_64-pc-freebsd10.0 2>&1 \ +// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s +// RUN: %clang -### -c -gline-directives-only -g %s -target i386-pc-solaris 2>&1 \ +// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s +// RUN: %clang -### -c -gline-directives-only -g0 %s 2>&1 \ +// RUN: | FileCheck -check-prefix=GLIO_NO %s +// // RUN: %clang -### -c -grecord-gcc-switches %s 2>&1 \ // | FileCheck -check-prefix=GRECORD %s // RUN: %clang -### -c -gno-record-gcc-switches %s 2>&1 \ @@ -178,6 +197,9 @@ // RUN: %clang -### -gmodules -gline-tables-only %s 2>&1 \ // RUN: | FileCheck -check-prefix=GLTO_ONLY %s // +// RUN: %clang -### -gmodules -gline-directives-only %s 2>&1 \ +// RUN: | FileCheck -check-prefix=GLIO_ONLY %s +// // G: "-cc1" // G: "-debug-info-kind=limited" // @@ -204,6 +226,15 @@ // GLTO_ONLY_DWARF2: "-debug-info-kind=line-tables-only" // GLTO_ONLY_DWARF2: "-dwarf-version=2" // +// GLIO_ONLY: "-cc1" +// GLIO_ONLY-NOT: "-dwarf-ext-refs" +// GLIO_ONLY: "-debug-info-kind=line-directives-only" +// GLIO_ONLY-NOT: "-dwarf-ext-refs" +// +// GLIO_ONLY_DWARF2: "-cc1" +// GLIO_ONLY_DWARF2: "-debug-info-kind=line-directives-only" +// GLIO_ONLY_DWARF2: "-dwarf-version=2" +// // G_ONLY: "-cc1" // G_ONLY: "-debug-info-kind=limited" // @@ -225,6 +256,10 @@ // GLTO_NO: "-cc1" // GLTO_NO-NOT: -debug-info-kind= // +// This tests asserts that "-gline-directives-only" "-g0" disables debug info. +// GLIO_NO: "-cc1" +// GLIO_NO-NOT: -debug-info-kind= +// // GRECORD: "-dwarf-debug-flags" // GRECORD: -### -c -grecord-gcc-switches // |