diff options
Diffstat (limited to 'clang/test/CodeGenCXX')
| -rw-r--r-- | clang/test/CodeGenCXX/PR20038.cpp | 2 | ||||
| -rw-r--r-- | clang/test/CodeGenCXX/debug-info-anon-union-vars.cpp | 4 | ||||
| -rw-r--r-- | clang/test/CodeGenCXX/debug-info-function-context.cpp | 4 | ||||
| -rw-r--r-- | clang/test/CodeGenCXX/debug-info-namespace.cpp | 14 | ||||
| -rw-r--r-- | clang/test/CodeGenCXX/debug-info-ptr-to-member-function.cpp | 10 | ||||
| -rw-r--r-- | clang/test/CodeGenCXX/debug-info-template-member.cpp | 19 | ||||
| -rw-r--r-- | clang/test/CodeGenCXX/debug-info.cpp | 7 | ||||
| -rw-r--r-- | clang/test/CodeGenCXX/debug-lambda-expressions.cpp | 55 | ||||
| -rw-r--r-- | clang/test/CodeGenCXX/debug-lambda-this.cpp | 4 | ||||
| -rw-r--r-- | clang/test/CodeGenCXX/linetable-virtual-variadic.cpp | 4 |
10 files changed, 61 insertions, 62 deletions
diff --git a/clang/test/CodeGenCXX/PR20038.cpp b/clang/test/CodeGenCXX/PR20038.cpp index 2d7043dcda3..095705f389b 100644 --- a/clang/test/CodeGenCXX/PR20038.cpp +++ b/clang/test/CodeGenCXX/PR20038.cpp @@ -7,8 +7,8 @@ extern bool b; // CHECK: call {{.*}}, !dbg [[DTOR_CALL1_LOC:![0-9]*]] // CHECK: call {{.*}}, !dbg [[DTOR_CALL2_LOC:![0-9]*]] // CHECK: [[FUN1:.*]] = distinct !DISubprogram(name: "fun1",{{.*}} isDefinition: true -// CHECK: [[FUN2:.*]] = distinct !DISubprogram(name: "fun2",{{.*}} isDefinition: true // CHECK: [[DTOR_CALL1_LOC]] = !DILocation(line: [[@LINE+1]], scope: [[FUN1]]) void fun1() { b && (C(), 1); } +// CHECK: [[FUN2:.*]] = distinct !DISubprogram(name: "fun2",{{.*}} isDefinition: true // CHECK: [[DTOR_CALL2_LOC]] = !DILocation(line: [[@LINE+1]], scope: [[FUN2]]) bool fun2() { return (C(), b) && 0; } diff --git a/clang/test/CodeGenCXX/debug-info-anon-union-vars.cpp b/clang/test/CodeGenCXX/debug-info-anon-union-vars.cpp index 5b0370eb749..80742250d84 100644 --- a/clang/test/CodeGenCXX/debug-info-anon-union-vars.cpp +++ b/clang/test/CodeGenCXX/debug-info-anon-union-vars.cpp @@ -44,8 +44,8 @@ void instantiate(int x) { buildBytes(x); } -// CHECK: [[FILE:.*]] = !DIFile(filename: "{{.*}}debug-info-anon-union-vars.cpp", -// CHECK: !DIGlobalVariable(name: "c",{{.*}} file: [[FILE]], line: 6,{{.*}} isLocal: true, isDefinition: true +// CHECK: !DIGlobalVariable(name: "c",{{.*}} file: [[FILE:.*]], line: 6,{{.*}} isLocal: true, isDefinition: true +// CHECK: [[FILE]] = !DIFile(filename: "{{.*}}debug-info-anon-union-vars.cpp", // CHECK: !DIGlobalVariable(name: "d",{{.*}} file: [[FILE]], line: 6,{{.*}} isLocal: true, isDefinition: true // CHECK: !DIGlobalVariable(name: "a",{{.*}} file: [[FILE]], line: 6,{{.*}} isLocal: true, isDefinition: true // CHECK: !DIGlobalVariable(name: "b",{{.*}} file: [[FILE]], line: 6,{{.*}} isLocal: true, isDefinition: true diff --git a/clang/test/CodeGenCXX/debug-info-function-context.cpp b/clang/test/CodeGenCXX/debug-info-function-context.cpp index 24f9f1bda63..47a8d4d6021 100644 --- a/clang/test/CodeGenCXX/debug-info-function-context.cpp +++ b/clang/test/CodeGenCXX/debug-info-function-context.cpp @@ -26,11 +26,11 @@ int global_namespace_variable = 1; // function has the file as a context. // CHECK: ![[FILE:[0-9]+]] = !DIFile(filename: "{{.*}}context.cpp", +// CHECK: ![[NS:.*]] = !DINamespace(name: "ns" // CHECK: !DISubprogram(name: "member_function",{{.*}} scope: !"_ZTS1C",{{.*}} isDefinition: true // CHECK: !DISubprogram(name: "static_member_function",{{.*}} scope: !"_ZTS1C",{{.*}} isDefinition: true // CHECK: !DISubprogram(name: "global_function",{{.*}} scope: ![[FILE]],{{.*}} isDefinition: true -// CHECK: !DISubprogram(name: "global_namespace_function",{{.*}} scope: ![[NS:[0-9]+]],{{.*}} isDefinition: true -// CHECK: ![[NS]] = !DINamespace(name: "ns" +// CHECK: !DISubprogram(name: "global_namespace_function",{{.*}} scope: ![[NS]],{{.*}} isDefinition: true diff --git a/clang/test/CodeGenCXX/debug-info-namespace.cpp b/clang/test/CodeGenCXX/debug-info-namespace.cpp index bebb24ab5d6..5cdf91bc1bf 100644 --- a/clang/test/CodeGenCXX/debug-info-namespace.cpp +++ b/clang/test/CodeGenCXX/debug-info-namespace.cpp @@ -67,10 +67,7 @@ void B::func_fwd() {} // CHECK: [[BAR:![0-9]+]] = !DICompositeType(tag: DW_TAG_structure_type, name: "bar", // CHECK-SAME: line: 6 // CHECK-SAME: DIFlagFwdDecl -// CHECK: [[F1:![0-9]+]] = distinct !DISubprogram(name: "f1",{{.*}} line: 4 -// CHECK-SAME: isDefinition: true -// CHECK: [[FUNC:![0-9]+]] = distinct !DISubprogram(name: "func",{{.*}} isDefinition: true -// CHECK: [[FUNC_FWD:![0-9]+]] = distinct !DISubprogram(name: "func_fwd",{{.*}} line: 47,{{.*}} isDefinition: true + // CHECK: [[I:![0-9]+]] = !DIGlobalVariable(name: "i",{{.*}} scope: [[NS]], // CHECK: [[VAR_FWD:![0-9]+]] = !DIGlobalVariable(name: "var_fwd",{{.*}} scope: [[NS]], // CHECK-SAME: line: 44 @@ -82,11 +79,15 @@ void B::func_fwd() {} // CHECK: [[M3]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, name: "E", scope: [[CU]], entity: [[CTXT]], line: 19) // CHECK: [[M4]] = !DIImportedEntity(tag: DW_TAG_imported_module, scope: [[LEX2:![0-9]+]], entity: [[NS]], line: 23) // CHECK: [[LEX2]] = distinct !DILexicalBlock(scope: [[LEX1:![0-9]+]], file: [[FOOCPP]], -// CHECK: [[LEX1]] = distinct !DILexicalBlock(scope: [[FUNC]], file: [[FOOCPP]], +// CHECK: [[LEX1]] = distinct !DILexicalBlock(scope: [[FUNC:![0-9]+]], file: [[FOOCPP]], +// CHECK: [[FUNC]] = distinct !DISubprogram(name: "func",{{.*}} isDefinition: true + // CHECK: [[M5]] = !DIImportedEntity(tag: DW_TAG_imported_module, scope: [[FUNC]], entity: [[CTXT]], // CHECK: [[M6]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: [[FUNC]], entity: [[FOO:!"_ZTSN1A1B3fooE"]], line: 27) // CHECK: [[M7]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: [[FUNC]], entity: [[BAR:!"_ZTSN1A1B3barE"]] -// CHECK: [[M8]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: [[FUNC]], entity: [[F1]] +// CHECK: [[M8]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: [[FUNC]], entity: [[F1:![0-9]+]] +// CHECK: [[F1:![0-9]+]] = distinct !DISubprogram(name: "f1",{{.*}} line: 4 +// CHECK-SAME: isDefinition: true // CHECK: [[M9]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: [[FUNC]], entity: [[I]] // CHECK: [[M10]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: [[FUNC]], entity: [[BAZ:![0-9]+]] // CHECK: [[BAZ]] = !DIDerivedType(tag: DW_TAG_typedef, name: "baz", scope: [[NS]], file: [[FOOCPP]], @@ -100,6 +101,7 @@ void B::func_fwd() {} // CHECK-SAME: scope: [[NS]], file: [[FOOCPP]], line: 9 // CHECK: [[M15]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: [[FUNC]], entity: [[VAR_FWD:![0-9]+]] // CHECK: [[M16]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: [[FUNC]], entity: [[FUNC_FWD:![0-9]+]] +// CHECK: [[FUNC_FWD]] = distinct !DISubprogram(name: "func_fwd",{{.*}} line: 47,{{.*}} isDefinition: true // CHECK: [[M17]] = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: [[CTXT]], entity: [[I]] // CHECK-GMLT: [[CU:![0-9]+]] = distinct !DICompileUnit( diff --git a/clang/test/CodeGenCXX/debug-info-ptr-to-member-function.cpp b/clang/test/CodeGenCXX/debug-info-ptr-to-member-function.cpp index cac16b60089..a7e02e48132 100644 --- a/clang/test/CodeGenCXX/debug-info-ptr-to-member-function.cpp +++ b/clang/test/CodeGenCXX/debug-info-ptr-to-member-function.cpp @@ -7,15 +7,15 @@ struct T { void foo(int (T::*method)()) {} -// A pointer to a member function is a pair of function- and this-pointer. -// CHECK: !DIDerivedType(tag: DW_TAG_ptr_to_member_type, -// DARWIN-X64-SAME: size: 128 -// WIN32-X64-SAME: size: 64 - struct Incomplete; int (Incomplete::**bar)(); +// A pointer to a member function is a pair of function- and this-pointer. // CHECK: !DIDerivedType(tag: DW_TAG_ptr_to_member_type, // DARWIN-X64-SAME: size: 128 // WIN32-X64-NOT: size: // CHECK-SAME: extraData: {{.*}}) + +// CHECK: !DIDerivedType(tag: DW_TAG_ptr_to_member_type, +// DARWIN-X64-SAME: size: 128 +// WIN32-X64-SAME: size: 64 diff --git a/clang/test/CodeGenCXX/debug-info-template-member.cpp b/clang/test/CodeGenCXX/debug-info-template-member.cpp index b94ff05df44..a6ba82aa943 100644 --- a/clang/test/CodeGenCXX/debug-info-template-member.cpp +++ b/clang/test/CodeGenCXX/debug-info-template-member.cpp @@ -50,15 +50,6 @@ inline int add3(int x) { // CHECK: [[ELEM_X]] = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !"_ZTS4elem" // CHECK-SAME: baseType: !"_ZTS4virtI4elemE" -// Check that the member function template specialization and implicit special -// members (the default ctor) refer to their class by scope, even though they -// didn't appear in the class's member list (C_MEM). This prevents the functions -// from being added to type units, while still appearing in the type -// declaration/reference in the compile unit. -// CHECK: !DISubprogram(name: "MyClass" -// CHECK-SAME: scope: !"_ZTS7MyClass" -// CHECK: !DISubprogram(name: "add<2>" -// CHECK-SAME: scope: !"_ZTS7MyClass" template<typename T> struct outer { @@ -98,3 +89,13 @@ inline void f1() { void f2() { virt<elem> d; // emit 'virt<elem>' } + +// Check that the member function template specialization and implicit special +// members (the default ctor) refer to their class by scope, even though they +// didn't appear in the class's member list (C_MEM). This prevents the functions +// from being added to type units, while still appearing in the type +// declaration/reference in the compile unit. +// CHECK: !DISubprogram(name: "MyClass" +// CHECK-SAME: scope: !"_ZTS7MyClass" +// CHECK: !DISubprogram(name: "add<2>" +// CHECK-SAME: scope: !"_ZTS7MyClass" diff --git a/clang/test/CodeGenCXX/debug-info.cpp b/clang/test/CodeGenCXX/debug-info.cpp index 29ed9e93156..394d8792fd8 100644 --- a/clang/test/CodeGenCXX/debug-info.cpp +++ b/clang/test/CodeGenCXX/debug-info.cpp @@ -114,9 +114,6 @@ foo func(foo f) { // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "b" // CHECK-SAME: DIFlagFwdDecl -// CHECK: [[FUNC:![0-9]+]] = distinct !DISubprogram(name: "func", linkageName: "_ZN7pr147634funcENS_3fooE" -// CHECK-SAME: type: [[FUNC_TYPE:![0-9]*]] -// CHECK-SAME: isDefinition: true } void foo() { @@ -141,6 +138,10 @@ incomplete (*x)[3]; // CHECK-SAME: baseType: !"_ZTSN6pr960810incompleteE" } +// CHECK: [[FUNC:![0-9]+]] = distinct !DISubprogram(name: "func", linkageName: "_ZN7pr147634funcENS_3fooE" +// CHECK-SAME: type: [[FUNC_TYPE:![0-9]*]] +// CHECK-SAME: isDefinition: true + // For some reason function arguments ended up down here // CHECK: ![[F]] = !DILocalVariable(name: "f", arg: 1, scope: [[FUNC]] // CHECK-SAME: type: !"[[FOO]]" diff --git a/clang/test/CodeGenCXX/debug-lambda-expressions.cpp b/clang/test/CodeGenCXX/debug-lambda-expressions.cpp index a022fad1b6b..3efdee54c98 100644 --- a/clang/test/CodeGenCXX/debug-lambda-expressions.cpp +++ b/clang/test/CodeGenCXX/debug-lambda-expressions.cpp @@ -19,18 +19,26 @@ int d(int x) { D y[10]; return [x,y] { return y[x].x; }(); } // CHECK: ![[INT:[0-9]+]] = !DIBasicType(name: "int" -// A: 10 -// CHECK: ![[A_FUNC:.*]] = distinct !DISubprogram(name: "a"{{.*}}, line: [[A_LINE:[0-9]+]]{{.*}}, isDefinition: true - -// B: 14 -// CHECK: ![[B_FUNC:.*]] = distinct !DISubprogram(name: "b"{{.*}}, line: [[B_LINE:[0-9]+]]{{.*}}, isDefinition: true - -// C: 17 -// CHECK: ![[C_FUNC:.*]] = distinct !DISubprogram(name: "c"{{.*}}, line: [[C_LINE:[0-9]+]]{{.*}}, isDefinition: true +// CVAR: +// CHECK: !DIGlobalVariable(name: "cvar" +// CHECK-SAME: line: [[CVAR_LINE:[0-9]+]] +// CHECK-SAME: type: ![[CVAR_T:[0-9]+]] +// CHECK: ![[CVAR_T]] = !DICompositeType(tag: DW_TAG_class_type +// CHECK-SAME: line: [[CVAR_LINE]], +// CHECK-SAME: elements: ![[CVAR_ARGS:[0-9]+]] +// CHECK: ![[CVAR_ARGS]] = !{!{{[0-9]+}}} -// D: 18 -// CHECK: ![[D_FUNC:.*]] = distinct !DISubprogram(name: "d"{{.*}}, line: [[D_LINE:[0-9]+]]{{.*}}, isDefinition: true +// VAR: +// CHECK: !DIGlobalVariable(name: "var" +// CHECK-SAME: line: [[VAR_LINE:[0-9]+]] +// CHECK-SAME: type: ![[VAR_T:[0-9]+]] +// CHECK: ![[VAR_T]] = !DICompositeType(tag: DW_TAG_class_type +// CHECK-SAME: line: [[VAR_LINE]], +// CHECK-SAME: elements: ![[VAR_ARGS:[0-9]+]] +// CHECK: ![[VAR_ARGS]] = !{!{{[0-9]+}}} +// A: 10 +// CHECK: ![[A_FUNC:.*]] = distinct !DISubprogram(name: "a"{{.*}}, line: [[A_LINE:[0-9]+]]{{.*}}, isDefinition: true // Back to A. -- 78 // CHECK: ![[LAM_A:.*]] = !DICompositeType(tag: DW_TAG_class_type{{.*}}, scope: ![[A_FUNC]]{{.*}}, line: [[A_LINE]], @@ -41,6 +49,9 @@ int d(int x) { D y[10]; return [x,y] { return y[x].x; }(); } // CHECK-SAME: line: [[A_LINE]] // CHECK-SAME: DIFlagPublic +// B: 14 +// CHECK: ![[B_FUNC:.*]] = distinct !DISubprogram(name: "b"{{.*}}, line: [[B_LINE:[0-9]+]]{{.*}}, isDefinition: true + // Back to B. -- 67 // CHECK: ![[LAM_B:.*]] = !DICompositeType(tag: DW_TAG_class_type{{.*}}, scope: ![[B_FUNC]]{{.*}}, line: [[B_LINE]], // CHECK-SAME: elements: ![[LAM_B_ARGS:[0-9]+]] @@ -54,6 +65,9 @@ int d(int x) { D y[10]; return [x,y] { return y[x].x; }(); } // CHECK-SAME: line: [[B_LINE]] // CHECK-SAME: DIFlagPublic +// C: 17 +// CHECK: ![[C_FUNC:.*]] = distinct !DISubprogram(name: "c"{{.*}}, line: [[C_LINE:[0-9]+]]{{.*}}, isDefinition: true + // Back to C. -- 55 // CHECK: ![[LAM_C:.*]] = !DICompositeType(tag: DW_TAG_class_type{{.*}}, scope: ![[C_FUNC]]{{.*}}, line: [[C_LINE]], // CHECK-SAME: elements: ![[LAM_C_ARGS:[0-9]+]] @@ -68,6 +82,9 @@ int d(int x) { D y[10]; return [x,y] { return y[x].x; }(); } // CHECK-SAME: line: [[C_LINE]] // CHECK-SAME: DIFlagPublic +// D: 18 +// CHECK: ![[D_FUNC:.*]] = distinct !DISubprogram(name: "d"{{.*}}, line: [[D_LINE:[0-9]+]]{{.*}}, isDefinition: true + // Back to D. -- 24 // CHECK: ![[LAM_D:.*]] = !DICompositeType(tag: DW_TAG_class_type{{.*}}, scope: ![[D_FUNC]]{{.*}}, line: [[D_LINE]], // CHECK-SAME: elements: ![[LAM_D_ARGS:[0-9]+]] @@ -82,21 +99,3 @@ int d(int x) { D y[10]; return [x,y] { return y[x].x; }(); } // CHECK-SAME: scope: ![[LAM_D]] // CHECK-SAME: line: [[D_LINE]] // CHECK-SAME: DIFlagPublic - -// CVAR: -// CHECK: !DIGlobalVariable(name: "cvar" -// CHECK-SAME: line: [[CVAR_LINE:[0-9]+]] -// CHECK-SAME: type: ![[CVAR_T:[0-9]+]] -// CHECK: ![[CVAR_T]] = !DICompositeType(tag: DW_TAG_class_type -// CHECK-SAME: line: [[CVAR_LINE]], -// CHECK-SAME: elements: ![[CVAR_ARGS:[0-9]+]] -// CHECK: ![[CVAR_ARGS]] = !{!{{[0-9]+}}} - -// VAR: -// CHECK: !DIGlobalVariable(name: "var" -// CHECK-SAME: line: [[VAR_LINE:[0-9]+]] -// CHECK-SAME: type: ![[VAR_T:[0-9]+]] -// CHECK: ![[VAR_T]] = !DICompositeType(tag: DW_TAG_class_type -// CHECK-SAME: line: [[VAR_LINE]], -// CHECK-SAME: elements: ![[VAR_ARGS:[0-9]+]] -// CHECK: ![[VAR_ARGS]] = !{!{{[0-9]+}}} diff --git a/clang/test/CodeGenCXX/debug-lambda-this.cpp b/clang/test/CodeGenCXX/debug-lambda-this.cpp index 0c413449a3e..e7ea68c1a35 100644 --- a/clang/test/CodeGenCXX/debug-lambda-this.cpp +++ b/clang/test/CodeGenCXX/debug-lambda-this.cpp @@ -12,10 +12,10 @@ int D::d(int x) { }(); } +// CHECK: ![[POINTER:.*]] = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTS1D", size: 64, align: 64) // CHECK: !DIDerivedType(tag: DW_TAG_member, name: "this", // CHECK-SAME: line: 11 -// CHECK-SAME: baseType: ![[POINTER:[0-9]+]] +// CHECK-SAME: baseType: ![[POINTER]] // CHECK-SAME: size: 64, align: 64 // CHECK-NOT: offset: 0 // CHECK-SAME: ){{$}} -// CHECK: ![[POINTER]] = !DIDerivedType(tag: DW_TAG_pointer_type diff --git a/clang/test/CodeGenCXX/linetable-virtual-variadic.cpp b/clang/test/CodeGenCXX/linetable-virtual-variadic.cpp index 8d1bf47814f..6f966416867 100644 --- a/clang/test/CodeGenCXX/linetable-virtual-variadic.cpp +++ b/clang/test/CodeGenCXX/linetable-virtual-variadic.cpp @@ -15,9 +15,5 @@ void Derived::VariadicFunction(...) { } // CHECK-LABEL: define void @_ZT{{.+}}N7Derived16VariadicFunctionEz( // CHECK: ret void, !dbg ![[LOC:[0-9]+]] // -// CHECK: !llvm.dbg.cu = !{![[CU:[0-9]+]]} -// -// CHECK: ![[CU]] = distinct !DICompileUnit({{.*}} subprograms: ![[SPs:[0-9]+]] -// CHECK: ![[SPs]] = !{![[SP]]} // CHECK: ![[SP]] = distinct !DISubprogram(name: "VariadicFunction" // CHECK: ![[LOC]] = !DILocation({{.*}}scope: ![[SP]]) |

