From f04be1fb3a9f4b8a7591824d6985556ac578e3cf Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Tue, 3 Mar 2015 17:25:55 +0000 Subject: [PATCH] DebugInfo: Move new hierarchy into place (clang) Update testcases for LLVM change in r231082 to use the new debug info hierarchy. llvm-svn: 231083 --- .../CodeGen/2005-12-04-DeclarationLineNumbers.c | 5 +- clang/test/CodeGen/2009-10-20-GlobalDebug.c | 10 +- clang/test/CodeGen/2010-02-15-DbgStaticVar.c | 4 +- clang/test/CodeGen/2010-02-16-DbgScopes.c | 8 +- clang/test/CodeGen/2010-03-09-DbgInfo.c | 3 +- clang/test/CodeGen/2010-03-5-LexicalScope.c | 4 +- clang/test/CodeGen/2010-08-10-DbgConstant.c | 3 +- clang/test/CodeGen/debug-info-args.c | 2 +- clang/test/CodeGen/debug-info-block-out-return.c | 4 +- clang/test/CodeGen/debug-info-block.c | 4 +- clang/test/CodeGen/debug-info-enum.c | 5 +- clang/test/CodeGen/debug-info-file-change.c | 11 +- clang/test/CodeGen/debug-info-gline-tables-only2.c | 6 +- clang/test/CodeGen/debug-info-limited.c | 4 +- clang/test/CodeGen/debug-info-same-line.c | 4 +- clang/test/CodeGen/debug-info-scope-file.c | 4 +- clang/test/CodeGen/debug-info-scope.c | 20 ++-- clang/test/CodeGen/debug-info-static.c | 2 +- clang/test/CodeGen/debug-info-typedef.c | 4 +- clang/test/CodeGen/debug-info-vector.c | 6 +- clang/test/CodeGen/debug-info-version.c | 2 +- clang/test/CodeGen/debug-info-vla.c | 4 +- clang/test/CodeGen/debug-info.c | 2 +- clang/test/CodeGen/lineno-dbginfo.c | 5 +- clang/test/CodeGenCXX/2010-07-23-DeclLoc.cpp | 5 +- .../CodeGenCXX/Inputs/debug-info-class-limited.cpp | 8 +- clang/test/CodeGenCXX/PR20038.cpp | 4 +- clang/test/CodeGenCXX/coverage.cpp | 6 +- clang/test/CodeGenCXX/debug-info-access.cpp | 22 ++-- clang/test/CodeGenCXX/debug-info-alias.cpp | 18 ++-- .../test/CodeGenCXX/debug-info-anon-union-vars.cpp | 10 +- .../test/CodeGenCXX/debug-info-artificial-arg.cpp | 12 ++- clang/test/CodeGenCXX/debug-info-blocks.cpp | 8 +- clang/test/CodeGenCXX/debug-info-char16.cpp | 3 +- clang/test/CodeGenCXX/debug-info-class-nolimit.cpp | 8 +- clang/test/CodeGenCXX/debug-info-class.cpp | 78 +++++++++----- clang/test/CodeGenCXX/debug-info-cxx1y.cpp | 17 ++- clang/test/CodeGenCXX/debug-info-decl-nested.cpp | 27 +++-- clang/test/CodeGenCXX/debug-info-dup-fwd-decl.cpp | 6 +- clang/test/CodeGenCXX/debug-info-enum-class.cpp | 64 +++++++++--- clang/test/CodeGenCXX/debug-info-enum.cpp | 28 +++-- clang/test/CodeGenCXX/debug-info-flex-member.cpp | 2 +- clang/test/CodeGenCXX/debug-info-fn-template.cpp | 4 +- .../CodeGenCXX/debug-info-function-context.cpp | 12 +-- clang/test/CodeGenCXX/debug-info-fwd-ref.cpp | 9 +- .../CodeGenCXX/debug-info-global-ctor-dtor.cpp | 16 +-- clang/test/CodeGenCXX/debug-info-global.cpp | 8 +- .../CodeGenCXX/debug-info-indirect-field-decl.cpp | 13 ++- clang/test/CodeGenCXX/debug-info-limited.cpp | 11 +- clang/test/CodeGenCXX/debug-info-method.cpp | 20 ++-- clang/test/CodeGenCXX/debug-info-namespace.cpp | 90 +++++++++------- clang/test/CodeGenCXX/debug-info-nullptr.cpp | 2 +- .../debug-info-ptr-to-member-function.cpp | 3 +- clang/test/CodeGenCXX/debug-info-qualifiers.cpp | 32 ++++-- clang/test/CodeGenCXX/debug-info-rvalue-ref.cpp | 3 +- clang/test/CodeGenCXX/debug-info-scope.cpp | 51 ++++++--- clang/test/CodeGenCXX/debug-info-static-fns.cpp | 5 +- clang/test/CodeGenCXX/debug-info-static-member.cpp | 84 +++++++++++---- ...debug-info-template-explicit-specialization.cpp | 47 +++++---- clang/test/CodeGenCXX/debug-info-template-fwd.cpp | 4 +- .../test/CodeGenCXX/debug-info-template-limit.cpp | 4 +- .../test/CodeGenCXX/debug-info-template-member.cpp | 45 +++++--- .../debug-info-template-partial-specialization.cpp | 6 +- .../test/CodeGenCXX/debug-info-template-quals.cpp | 20 ++-- clang/test/CodeGenCXX/debug-info-template.cpp | 116 ++++++++++++--------- clang/test/CodeGenCXX/debug-info-thunk.cpp | 5 +- .../test/CodeGenCXX/debug-info-union-template.cpp | 6 +- clang/test/CodeGenCXX/debug-info-union.cpp | 12 ++- clang/test/CodeGenCXX/debug-info-uuid.cpp | 33 ++++-- clang/test/CodeGenCXX/debug-info-varargs.cpp | 18 ++-- clang/test/CodeGenCXX/debug-info-vtable-optzn.cpp | 2 +- clang/test/CodeGenCXX/debug-info-wchar.cpp | 2 +- clang/test/CodeGenCXX/debug-info-windows-dtor.cpp | 2 +- .../CodeGenCXX/debug-info-zero-length-arrays.cpp | 10 +- clang/test/CodeGenCXX/debug-info.cpp | 66 ++++++++---- clang/test/CodeGenCXX/debug-lambda-expressions.cpp | 92 +++++++++++----- clang/test/CodeGenCXX/debug-lambda-this.cpp | 8 +- clang/test/CodeGenCXX/field-access-debug-info.cpp | 9 +- clang/test/CodeGenCXX/globalinit-loc.cpp | 5 +- clang/test/CodeGenCXX/inline-dllexport-member.cpp | 5 +- clang/test/CodeGenCXX/linetable-cleanup.cpp | 4 +- clang/test/CodeGenCXX/linetable-eh.cpp | 4 +- clang/test/CodeGenCXX/linetable-fnbegin.cpp | 6 +- clang/test/CodeGenCXX/scoped-enums-debug-info.cpp | 11 +- .../CodeGenCXX/vtable-holder-self-reference.cpp | 3 +- clang/test/CodeGenObjC/2010-02-09-DbgSelf.m | 2 +- .../test/CodeGenObjC/2010-02-15-Dbg-MethodStart.m | 2 +- clang/test/CodeGenObjC/arc-linetable.m | 4 +- clang/test/CodeGenObjC/block-byref-debuginfo.m | 5 +- clang/test/CodeGenObjC/catch-lexical-block.m | 8 +- .../CodeGenObjC/debug-info-block-captured-self.m | 10 +- clang/test/CodeGenObjC/debug-info-block-helper.m | 2 +- clang/test/CodeGenObjC/debug-info-block-type.m | 17 +-- clang/test/CodeGenObjC/debug-info-blocks.m | 8 +- clang/test/CodeGenObjC/debug-info-fwddecl.m | 7 +- clang/test/CodeGenObjC/debug-info-getter-name.m | 2 +- .../test/CodeGenObjC/debug-info-id-with-protocol.m | 11 +- clang/test/CodeGenObjC/debug-info-impl.m | 3 +- clang/test/CodeGenObjC/debug-info-instancetype.m | 13 ++- .../test/CodeGenObjC/debug-info-ivars-extension.m | 22 +++- clang/test/CodeGenObjC/debug-info-ivars-indirect.m | 8 +- clang/test/CodeGenObjC/debug-info-ivars-private.m | 15 ++- clang/test/CodeGenObjC/debug-info-ivars.m | 28 ++++- clang/test/CodeGenObjC/debug-info-lifetime-crash.m | 8 +- .../CodeGenObjC/debug-info-property-accessors.m | 3 +- clang/test/CodeGenObjC/debug-info-property3.m | 4 +- clang/test/CodeGenObjC/debug-info-pubtypes.m | 4 +- clang/test/CodeGenObjC/debug-info-self.m | 16 ++- clang/test/CodeGenObjC/debug-info-static-var.m | 4 +- clang/test/CodeGenObjC/debug-info-synthesis.m | 7 +- .../test/CodeGenObjC/debug-info-variadic-method.m | 4 +- clang/test/CodeGenObjC/debug-property-synth.m | 4 +- clang/test/CodeGenObjC/debuginfo-properties.m | 17 ++- clang/test/CodeGenObjC/objc-fixed-enum.m | 40 ++++--- clang/test/CodeGenObjCXX/debug-info-cyclic.mm | 20 ++-- clang/test/Driver/darwin-debug-flags.c | 10 +- clang/test/PCH/debug-info-limited-struct.c | 4 +- clang/test/VFS/external-names.c | 4 +- 118 files changed, 1108 insertions(+), 568 deletions(-) diff --git a/clang/test/CodeGen/2005-12-04-DeclarationLineNumbers.c b/clang/test/CodeGen/2005-12-04-DeclarationLineNumbers.c index 596d3ee..82ea1f9 100644 --- a/clang/test/CodeGen/2005-12-04-DeclarationLineNumbers.c +++ b/clang/test/CodeGen/2005-12-04-DeclarationLineNumbers.c @@ -1,7 +1,8 @@ -// RUN: %clang_cc1 %s -emit-llvm -g -o - | grep DW_TAG_compile_unit | count 1 +// RUN: %clang_cc1 %s -emit-llvm -g -o - | FileCheck %s +// CHECK: !MDCompileUnit( +// CHECK-NOT: !MDCompileUnit( // PR664: ensure that line #'s are emitted for declarations - short test(short br_data_0, short br_data_1, short br_data_2, diff --git a/clang/test/CodeGen/2009-10-20-GlobalDebug.c b/clang/test/CodeGen/2009-10-20-GlobalDebug.c index e56f227..44be13a 100644 --- a/clang/test/CodeGen/2009-10-20-GlobalDebug.c +++ b/clang/test/CodeGen/2009-10-20-GlobalDebug.c @@ -6,5 +6,11 @@ int main() { return 0; } -// CHECK: !"0x34\00localstatic\00localstatic\00\005\001\001", !{{.*}}, !{{.*}}, !{{.*}}, i32* @main.localstatic, null} ; [ DW_TAG_variable ] -// CHECK: !"0x34\00global\00global\00\003\000\001", null, !{{.*}}, !{{.*}}, i32* @global, null} ; [ DW_TAG_variable ] +// CHECK: !MDGlobalVariable(name: "localstatic" +// CHECK-NOT: linkageName: +// CHECK-SAME: line: 5, +// CHECK-SAME: variable: i32* @main.localstatic +// CHECK: !MDGlobalVariable(name: "global" +// CHECK-NOT: linkageName: +// CHECK-SAME: line: 3, +// CHECK-SAME: variable: i32* @global diff --git a/clang/test/CodeGen/2010-02-15-DbgStaticVar.c b/clang/test/CodeGen/2010-02-15-DbgStaticVar.c index 8980b60..60302d6 100644 --- a/clang/test/CodeGen/2010-02-15-DbgStaticVar.c +++ b/clang/test/CodeGen/2010-02-15-DbgStaticVar.c @@ -11,4 +11,6 @@ int main() { int j = foo(1); return 0; } -// CHECK: !"0x34\00b\00b\00\00{{.*}}", +// CHECK: !MDGlobalVariable(name: "b", +// CHECK-NOT: linkageName: +// CHECK-SAME: ){{$}} diff --git a/clang/test/CodeGen/2010-02-16-DbgScopes.c b/clang/test/CodeGen/2010-02-16-DbgScopes.c index 36484a4..daae53d 100644 --- a/clang/test/CodeGen/2010-02-16-DbgScopes.c +++ b/clang/test/CodeGen/2010-02-16-DbgScopes.c @@ -1,9 +1,9 @@ // RUN: %clang_cc1 -emit-llvm -g < %s | FileCheck %s // Test to check number of lexical scope identified in debug info. -// CHECK: DW_TAG_lexical_block -// CHECK: DW_TAG_lexical_block -// CHECK: DW_TAG_lexical_block -// CHECK: DW_TAG_lexical_block +// CHECK: !MDLexicalBlock( +// CHECK: !MDLexicalBlock( +// CHECK: !MDLexicalBlock( +// CHECK: !MDLexicalBlock( extern int bar(); extern void foobar(); diff --git a/clang/test/CodeGen/2010-03-09-DbgInfo.c b/clang/test/CodeGen/2010-03-09-DbgInfo.c index 3541e5f..3a98e4c 100644 --- a/clang/test/CodeGen/2010-03-09-DbgInfo.c +++ b/clang/test/CodeGen/2010-03-09-DbgInfo.c @@ -1,2 +1,3 @@ -// RUN: %clang -emit-llvm -S -O0 -g %s -o - | grep DW_TAG_variable +// RUN: %clang -emit-llvm -S -O0 -g %s -o - | FileCheck %s +// CHECK: !MDGlobalVariable( unsigned char ctable1[1] = { 0001 }; diff --git a/clang/test/CodeGen/2010-03-5-LexicalScope.c b/clang/test/CodeGen/2010-03-5-LexicalScope.c index 8dc68d7..bec7d84 100644 --- a/clang/test/CodeGen/2010-03-5-LexicalScope.c +++ b/clang/test/CodeGen/2010-03-5-LexicalScope.c @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -emit-llvm -g %s -o - | FileCheck %s -// CHECK: DW_TAG_lexical_block -// CHECK: DW_TAG_lexical_block +// CHECK: !MDLexicalBlock( +// CHECK: !MDLexicalBlock( int foo(int i) { if (i) { int j = 2; diff --git a/clang/test/CodeGen/2010-08-10-DbgConstant.c b/clang/test/CodeGen/2010-08-10-DbgConstant.c index 5b8f064..e07a184 100644 --- a/clang/test/CodeGen/2010-08-10-DbgConstant.c +++ b/clang/test/CodeGen/2010-08-10-DbgConstant.c @@ -1,4 +1,5 @@ -// RUN: %clang_cc1 -S -emit-llvm -g %s -o - | grep DW_TAG_variable +// RUN: %clang_cc1 -S -emit-llvm -g %s -o - | FileCheck %s +// CHECK: !MDGlobalVariable( static const unsigned int ro = 201; void bar(int); diff --git a/clang/test/CodeGen/debug-info-args.c b/clang/test/CodeGen/debug-info-args.c index 33cf5bc..9389047 100644 --- a/clang/test/CodeGen/debug-info-args.c +++ b/clang/test/CodeGen/debug-info-args.c @@ -2,7 +2,7 @@ int somefunc(char *x, int y, double z) { - // CHECK: ![[NUM:[^,]*]], null, null, null} ; [ DW_TAG_subroutine_type + // CHECK: !MDSubroutineType(types: ![[NUM:[0-9]+]]) // CHECK: ![[NUM]] = {{!{![^,]*, ![^,]*, ![^,]*, ![^,]*}}} return y; diff --git a/clang/test/CodeGen/debug-info-block-out-return.c b/clang/test/CodeGen/debug-info-block-out-return.c index 47b90ce..282fa4f 100644 --- a/clang/test/CodeGen/debug-info-block-out-return.c +++ b/clang/test/CodeGen/debug-info-block-out-return.c @@ -11,8 +11,8 @@ // out of order or not at all (the latter would occur if they were both assigned // the same argument number by mistake). -// CHECK: !"0x101\00.block_descriptor\0016777218\00{{[0-9]+}}", {{.*}} ; [ DW_TAG_arg_variable ] [.block_descriptor] -// CHECK: !"0x101\00param\0033554434\00{{[0-9]+}}", {{.*}} ; [ DW_TAG_arg_variable ] [param] +// CHECK: !MDLocalVariable(tag: DW_TAG_arg_variable, name: ".block_descriptor", arg: 1,{{.*}}line: 2, +// CHECK: !MDLocalVariable(tag: DW_TAG_arg_variable, name: "param", arg: 2,{{.*}}line: 2, // Line directive so we don't have to worry about how many lines preceed the // test code (as the line number is mangled in with the argument number as shown diff --git a/clang/test/CodeGen/debug-info-block.c b/clang/test/CodeGen/debug-info-block.c index 35ee0dd..4b5706b 100644 --- a/clang/test/CodeGen/debug-info-block.c +++ b/clang/test/CodeGen/debug-info-block.c @@ -2,8 +2,8 @@ // Verify that the desired debugging type is generated for a structure // member that is a pointer to a block. -// CHECK: __block_literal_generic{{.*}}DW_TAG_structure_type -// CHECK: __block_descriptor{{.*}}DW_TAG_structure_type +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "__block_literal_generic" +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "__block_descriptor" struct inStruct { void (^genericBlockPtr)(); } is; diff --git a/clang/test/CodeGen/debug-info-enum.c b/clang/test/CodeGen/debug-info-enum.c index 1f6b384..e32c731 100644 --- a/clang/test/CodeGen/debug-info-enum.c +++ b/clang/test/CodeGen/debug-info-enum.c @@ -1,8 +1,9 @@ // RUN: %clang_cc1 -emit-llvm -g %s -o - | FileCheck %s -// CHECK: [[TEST3_ENUMS:![0-9]*]], null, null, null} ; [ DW_TAG_enumeration_type ] [e] +// CHECK: !MDCompositeType(tag: DW_TAG_enumeration_type, name: "e" +// CHECK-SAME: elements: [[TEST3_ENUMS:![0-9]*]] // CHECK: [[TEST3_ENUMS]] = !{[[TEST3_E:![0-9]*]]} -// CHECK: [[TEST3_E]] = !{!"0x28\00E\00-1"} ; [ DW_TAG_enumerator ] [E :: -1] +// CHECK: [[TEST3_E]] = !MDEnumerator(name: "E", value: -1) enum e; void func(enum e *p) { diff --git a/clang/test/CodeGen/debug-info-file-change.c b/clang/test/CodeGen/debug-info-file-change.c index 8f869d0..f4c1251 100644 --- a/clang/test/CodeGen/debug-info-file-change.c +++ b/clang/test/CodeGen/debug-info-file-change.c @@ -14,8 +14,9 @@ int foo() { return i + j; } -// CHECK: DW_TAG_lexical_block -// CHECK: !"m.h" -// CHECK: DW_TAG_lexical_block -// CHECK: !"m.c" -// CHECK-NOT: DW_TAG_lexical_block +// CHECK-NOT: !MDLexicalBlock +// CHECK: !MDLexicalBlockFile({{.*}}file: ![[MH:[0-9]+]] +// CHECK: !MDFile(filename: "m.h" +// CHECK: !MDLexicalBlockFile({{.*}}file: ![[MC:[0-9]+]] +// CHECK: !MDFile(filename: "m.c" +// CHECK-NOT: !MDLexicalBlock diff --git a/clang/test/CodeGen/debug-info-gline-tables-only2.c b/clang/test/CodeGen/debug-info-gline-tables-only2.c index 8e9cc64..e28856f 100644 --- a/clang/test/CodeGen/debug-info-gline-tables-only2.c +++ b/clang/test/CodeGen/debug-info-gline-tables-only2.c @@ -8,6 +8,6 @@ int main() { } // CHECK: !llvm.dbg.cu = !{!0} -// CHECK: DW_TAG_compile_unit -// CHECK: {{.*main.* DW_TAG_subprogram}} -// CHECK: DW_TAG_file_type +// CHECK: !MDCompileUnit( +// CHECK: !MDSubprogram( +// CHECK: !MDFile( diff --git a/clang/test/CodeGen/debug-info-limited.c b/clang/test/CodeGen/debug-info-limited.c index 7333452..72f9fb7 100644 --- a/clang/test/CodeGen/debug-info-limited.c +++ b/clang/test/CodeGen/debug-info-limited.c @@ -3,7 +3,9 @@ // Ensure we emit the full definition of 'foo' even though only its declaration // is needed, since C has no ODR to ensure that the definition will be the same // in whatever TU actually uses/requires the definition of 'foo'. -// CHECK: ; [ DW_TAG_structure_type ] [foo] {{.*}} [def] +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "foo", +// CHECK-NOT: DIFlagFwdDecl +// CHECK-SAME: ){{$}} struct foo { }; diff --git a/clang/test/CodeGen/debug-info-same-line.c b/clang/test/CodeGen/debug-info-same-line.c index dddabda..e9fe3a7 100644 --- a/clang/test/CodeGen/debug-info-same-line.c +++ b/clang/test/CodeGen/debug-info-same-line.c @@ -2,6 +2,6 @@ // Here two temporary nodes are identical (but should not get uniqued) while // building the full debug type. typedef struct { long x; } foo; typedef struct { foo *x; } bar; -// CHECK: [ DW_TAG_structure_type ] [line 4, size 64, -// CHECK: [ DW_TAG_structure_type ] [line 4, size 64, +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type,{{.*}} line: 4, size: 64, +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type,{{.*}} line: 4, size: 64, bar b; diff --git a/clang/test/CodeGen/debug-info-scope-file.c b/clang/test/CodeGen/debug-info-scope-file.c index 226fb27..74456a0 100644 --- a/clang/test/CodeGen/debug-info-scope-file.c +++ b/clang/test/CodeGen/debug-info-scope-file.c @@ -5,8 +5,8 @@ // CHECK: ret void, !dbg [[F1_LINE:![0-9]*]] // CHECK: ret void, !dbg [[F2_LINE:![0-9]*]] -// CHECK: [[F1:![0-9]*]] = {{.*}} ; [ DW_TAG_subprogram ] {{.*}} [def] [f1] -// CHECK: [[F2:![0-9]*]] = {{.*}} ; [ DW_TAG_subprogram ] {{.*}} [def] [f2] +// CHECK: [[F1:![0-9]*]] = !MDSubprogram(name: "f1",{{.*}} isDefinition: true +// CHECK: [[F2:![0-9]*]] = !MDSubprogram(name: "f2",{{.*}} isDefinition: true // CHECK: [[F1_LINE]] = !MDLocation({{.*}}, scope: [[F1]]) // CHECK: [[F2_LINE]] = !MDLocation({{.*}}, scope: [[F2]]) diff --git a/clang/test/CodeGen/debug-info-scope.c b/clang/test/CodeGen/debug-info-scope.c index d84fafd..5709e3e 100644 --- a/clang/test/CodeGen/debug-info-scope.c +++ b/clang/test/CodeGen/debug-info-scope.c @@ -5,23 +5,23 @@ int main() { int j = 0; int k = 0; -// CHECK: DW_TAG_auto_variable ] [i] -// CHECK-NEXT: DW_TAG_lexical_block +// CHECK: !MDLocalVariable(tag: DW_TAG_auto_variable, name: "i" +// CHECK-NEXT: !MDLexicalBlock( // FIXME: Looks like we don't actually need both these lexical blocks (disc 2 // just refers to disc 1, nothing actually uses disc 2). -// GMLT-NOT: DW_TAG_lexical_block -// GMLT: "0xb\002", {{.*}}} ; [ DW_TAG_lexical_block ] -// GMLT-NOT: DW_TAG_lexical_block -// GMLT: "0xb\001", {{.*}}} ; [ DW_TAG_lexical_block ] +// GMLT-NOT: !MDLexicalBlock +// GMLT: !MDLexicalBlockFile({{.*}}, discriminator: 2) +// GMLT-NOT: !MDLexicalBlock +// GMLT: !MDLexicalBlockFile({{.*}}, discriminator: 1) // Make sure we don't have any more lexical blocks because we don't need them in // -gmlt. -// GMLT-NOT: DW_TAG_lexical_block +// GMLT-NOT: !MDLexicalBlock for (int i = 0; i < 10; i++) j++; -// CHECK: DW_TAG_auto_variable ] [i] -// CHECK-NEXT: DW_TAG_lexical_block -// GMLT-NOT: DW_TAG_lexical_block +// CHECK: !MDLocalVariable(tag: DW_TAG_auto_variable, name: "i" +// CHECK-NEXT: !MDLexicalBlock( +// GMLT-NOT: !MDLexicalBlock for (int i = 0; i < 10; i++) k++; return 0; diff --git a/clang/test/CodeGen/debug-info-static.c b/clang/test/CodeGen/debug-info-static.c index 931c9e2..cd4526a 100644 --- a/clang/test/CodeGen/debug-info-static.c +++ b/clang/test/CodeGen/debug-info-static.c @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -g -emit-llvm -o - %s | FileCheck %s -// CHECK: xyzzy, null} ; [ DW_TAG_variable ] +// CHECK: !MDGlobalVariable({{.*}}variable: i32* @f.xyzzy void f(void) { static int xyzzy; diff --git a/clang/test/CodeGen/debug-info-typedef.c b/clang/test/CodeGen/debug-info-typedef.c index 3db7d53..a50b7f1 100644 --- a/clang/test/CodeGen/debug-info-typedef.c +++ b/clang/test/CodeGen/debug-info-typedef.c @@ -7,5 +7,5 @@ typedef int MyType; MyType a; -// CHECK: !"0x16\00MyType\002\00{{.*}}", ![[HEADER:[0-9]+]], null{{.*}}} ; [ DW_TAG_typedef ] [MyType] [line 2, size 0, align 0, offset 0] [from int] -// CHECK: ![[HEADER]] = !{!"b.h", +// CHECK: !MDDerivedType(tag: DW_TAG_typedef, name: "MyType", file: ![[HEADER:[0-9]+]], line: 2, +// CHECK: ![[HEADER]] = !MDFile(filename: "b.h", diff --git a/clang/test/CodeGen/debug-info-vector.c b/clang/test/CodeGen/debug-info-vector.c index b7135af..047f1b2 100644 --- a/clang/test/CodeGen/debug-info-vector.c +++ b/clang/test/CodeGen/debug-info-vector.c @@ -4,4 +4,8 @@ typedef int v4si __attribute__((__vector_size__(16))); v4si a; // Test that we get an array type that's also a vector out of debug. -// CHECK: [ DW_TAG_array_type ] [line 0, size 128, align 128, offset 0] [vector] [from int] +// CHECK: !MDCompositeType(tag: DW_TAG_array_type, +// CHECK-SAME: baseType: ![[INT:[0-9]+]] +// CHECK-SAME: size: 128, align: 128 +// CHECK-SAME: DIFlagVector +// CHECK: ![[INT]] = !MDBasicType(name: "int" diff --git a/clang/test/CodeGen/debug-info-version.c b/clang/test/CodeGen/debug-info-version.c index 5fe2e4e..fa7e20e 100644 --- a/clang/test/CodeGen/debug-info-version.c +++ b/clang/test/CodeGen/debug-info-version.c @@ -4,5 +4,5 @@ int main (void) { return 0; } -// CHECK: i32 2, !"Debug Info Version", i32 2} +// CHECK: i32 2, !"Debug Info Version", i32 3} // NO_DEBUG-NOT: !"Debug Info Version" diff --git a/clang/test/CodeGen/debug-info-vla.c b/clang/test/CodeGen/debug-info-vla.c index 7d321cf..d58dc91 100644 --- a/clang/test/CodeGen/debug-info-vla.c +++ b/clang/test/CodeGen/debug-info-vla.c @@ -4,8 +4,8 @@ void testVLAwithSize(int s) { // CHECK: dbg.declare // CHECK: dbg.declare({{.*}}, metadata ![[VAR:.*]], metadata ![[EXPR:.*]]) -// CHECK: ![[VAR]] = {{.*}} ; [ DW_TAG_auto_variable ] [vla] [line [[@LINE+2]]] -// CHECK: ![[EXPR]] = {{.*}} ; [ DW_TAG_expression ] [DW_OP_deref] +// CHECK: ![[VAR]] = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "vla",{{.*}} line: [[@LINE+2]] +// CHECK: ![[EXPR]] = !MDExpression(DW_OP_deref) int vla[s]; int i; for (i = 0; i < s; i++) { diff --git a/clang/test/CodeGen/debug-info.c b/clang/test/CodeGen/debug-info.c index bf08c589..e1ee087 100644 --- a/clang/test/CodeGen/debug-info.c +++ b/clang/test/CodeGen/debug-info.c @@ -42,7 +42,7 @@ struct foo2 foo2; // Radar 7325611 -// CHECK: !"0x16\00barfoo\00{{.*}}" +// CHECK: !MDDerivedType(tag: DW_TAG_typedef, name: "barfoo" typedef int barfoo; barfoo foo() { } diff --git a/clang/test/CodeGen/lineno-dbginfo.c b/clang/test/CodeGen/lineno-dbginfo.c index 28c7243..1a0b701 100644 --- a/clang/test/CodeGen/lineno-dbginfo.c +++ b/clang/test/CodeGen/lineno-dbginfo.c @@ -1,6 +1,9 @@ // RUN: echo "#include " > %t.h // RUN: %clang_cc1 -S -g -include %t.h %s -emit-llvm -o - | FileCheck %s -// CHECK: !"0x34\00outer\00outer\00\00[[@LINE+1]]\000\001" +// CHECK: !MDGlobalVariable(name: "outer", +// CHECK-NOT: linkageName: +// CHECK-SAME: line: [[@LINE+2]] +// CHECK-SAME: isDefinition: true int outer = 42; diff --git a/clang/test/CodeGenCXX/2010-07-23-DeclLoc.cpp b/clang/test/CodeGenCXX/2010-07-23-DeclLoc.cpp index 56c364c..a1e1739 100644 --- a/clang/test/CodeGenCXX/2010-07-23-DeclLoc.cpp +++ b/clang/test/CodeGenCXX/2010-07-23-DeclLoc.cpp @@ -1,9 +1,10 @@ // RUN: %clang_cc1 -emit-llvm -g %s -o - | FileCheck %s // Require the template function declaration refer to the correct filename. // First, locate the function decl in metadata, and pluck out the file handle: -// CHECK: !"0x2e\00extract_dwarf_data_from_header{{[^"]+}}", [[filehandle:![0-9]+]] +// CHECK: !MDSubprogram(name: "extract_dwarf_data_from_header +// CHECK-SAME: file: [[FILE:![0-9]+]] // Second: Require that filehandle refer to the correct filename: -// CHECK: [[filehandle]] = {{.*}}decl_should_be_here.hpp" +// CHECK: [[FILE]] = !MDFile(filename: "decl_should_be_here.hpp" typedef long unsigned int __darwin_size_t; typedef __darwin_size_t size_t; typedef unsigned char uint8_t; diff --git a/clang/test/CodeGenCXX/Inputs/debug-info-class-limited.cpp b/clang/test/CodeGenCXX/Inputs/debug-info-class-limited.cpp index 31a0261..be3d6db 100644 --- a/clang/test/CodeGenCXX/Inputs/debug-info-class-limited.cpp +++ b/clang/test/CodeGenCXX/Inputs/debug-info-class-limited.cpp @@ -1,5 +1,5 @@ -// CHECK-DAG: [ DW_TAG_structure_type ] [PR16214] [line [[@LINE+1]], {{.*}} [def] +// CHECK-DAG: !MDCompositeType(tag: DW_TAG_structure_type, name: "PR16214",{{.*}} line: [[@LINE+1]],{{.*}} isDefinition: true struct PR16214 { int i; }; @@ -10,7 +10,7 @@ bar *a; bar b; namespace PR14467 { -// CHECK-DAG: [ DW_TAG_structure_type ] [foo] [line [[@LINE+1]], {{.*}} [def] +// CHECK-DAG: !MDCompositeType(tag: DW_TAG_structure_type, name: "foo",{{.*}} line: [[@LINE+1]],{{.*}} isDefinition: true struct foo { }; @@ -21,7 +21,7 @@ foo *bar(foo *a) { } namespace test1 { -// CHECK-DAG: [ DW_TAG_structure_type ] [foo] [line [[@LINE+1]], {{.*}} [def] +// CHECK-DAG: !MDCompositeType(tag: DW_TAG_structure_type, name: "foo",{{.*}} line: [[@LINE+1]],{{.*}} isDefinition: true struct foo { }; @@ -35,7 +35,7 @@ namespace test2 { // FIXME: if we were a bit fancier, we could realize that the 'foo' type is only // required because of the 'bar' type which is not required at all (or might // only be required to be declared) -// CHECK-DAG: [ DW_TAG_structure_type ] [foo] [line [[@LINE+1]], {{.*}} [def] +// CHECK-DAG: !MDCompositeType(tag: DW_TAG_structure_type, name: "foo",{{.*}} line: [[@LINE+1]],{{.*}} isDefinition: true struct foo { }; diff --git a/clang/test/CodeGenCXX/PR20038.cpp b/clang/test/CodeGenCXX/PR20038.cpp index 0936dfc..a76a100 100644 --- a/clang/test/CodeGenCXX/PR20038.cpp +++ b/clang/test/CodeGenCXX/PR20038.cpp @@ -6,8 +6,8 @@ struct C { extern bool b; // CHECK: call {{.*}}, !dbg [[DTOR_CALL1_LOC:![0-9]*]] // CHECK: call {{.*}}, !dbg [[DTOR_CALL2_LOC:![0-9]*]] -// CHECK: [[FUN1:.*]] = {{.*}}; [ DW_TAG_subprogram ] {{.*}} [def] [fun1] -// CHECK: [[FUN2:.*]] = {{.*}}; [ DW_TAG_subprogram ] {{.*}} [def] [fun2] +// CHECK: [[FUN1:.*]] = !MDSubprogram(name: "fun1",{{.*}} isDefinition: true +// CHECK: [[FUN2:.*]] = !MDSubprogram(name: "fun2",{{.*}} isDefinition: true // CHECK: [[DTOR_CALL1_LOC]] = !MDLocation(line: [[@LINE+1]], scope: [[FUN1]]) void fun1() { b && (C(), 1); } // CHECK: [[DTOR_CALL2_LOC]] = !MDLocation(line: [[@LINE+1]], scope: [[FUN2]]) diff --git a/clang/test/CodeGenCXX/coverage.cpp b/clang/test/CodeGenCXX/coverage.cpp index 3931b0c..5460e2b 100644 --- a/clang/test/CodeGenCXX/coverage.cpp +++ b/clang/test/CodeGenCXX/coverage.cpp @@ -3,5 +3,7 @@ extern "C" void test_name1() {} void test_name2() {} -// CHECK: !"0x2e\00test_name1\00test_name1\00\00{{[^,]+}}", {{.*}} DW_TAG_subprogram -// CHECK: !"0x2e\00test_name2\00test_name2\00_Z10test_name2v\00{{[^,]+}}", {{.*}} DW_TAG_subprogram +// CHECK: !MDSubprogram(name: "test_name1", +// CHECK-NOT: linkageName: +// CHECK-SAME: ){{$}} +// CHECK: !MDSubprogram(name: "test_name2", linkageName: "_Z10test_name2v" diff --git a/clang/test/CodeGenCXX/debug-info-access.cpp b/clang/test/CodeGenCXX/debug-info-access.cpp index d6dfd87..d2ae8f4 100644 --- a/clang/test/CodeGenCXX/debug-info-access.cpp +++ b/clang/test/CodeGenCXX/debug-info-access.cpp @@ -1,37 +1,39 @@ // RUN: %clang_cc1 -emit-llvm -g -triple %itanium_abi_triple %s -o - | FileCheck %s // Test the various accessibility flags in the debug info. struct A { - // CHECK-DAG: [ DW_TAG_subprogram ] [line [[@LINE+1]]] [pub_default] + // CHECK-DAG: !MDSubprogram(name: "pub_default",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagPrototyped, void pub_default(); - // CHECK-DAG: [ DW_TAG_member ] [pub_default_static] [line [[@LINE+1]]{{.*}}offset 0] [static] + // CHECK-DAG: !MDDerivedType(tag: DW_TAG_member, name: "pub_default_static",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagStaticMember) static int pub_default_static; }; -// CHECK: [ DW_TAG_inheritance ] {{.*}} [public] [from {{.*}}A] +// CHECK: !MDDerivedType(tag: DW_TAG_inheritance,{{.*}} baseType: !"_ZTS1A",{{.*}} flags: DIFlagPublic) class B : public A { public: - // CHECK-DAG: [ DW_TAG_subprogram ] [line [[@LINE+1]]] [public] [pub] + // CHECK-DAG: !MDSubprogram(name: "pub",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagPublic | DIFlagPrototyped, void pub(); - // CHECK-DAG: [ DW_TAG_member ] [public_static] [line [[@LINE+1]]{{.*}} [public] [static] + // CHECK-DAG: !MDDerivedType(tag: DW_TAG_member, name: "public_static",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagPublic | DIFlagStaticMember) static int public_static; protected: - // CHECK: [ DW_TAG_subprogram ] [line [[@LINE+1]]] [protected] [prot] + // CHECK: !MDSubprogram(name: "prot",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagProtected | DIFlagPrototyped, void prot(); private: - // CHECK: [ DW_TAG_subprogram ] [line [[@LINE+1]]] [priv_default] + // CHECK: !MDSubprogram(name: "priv_default",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagPrototyped, void priv_default(); }; union U { - // CHECK-DAG: [ DW_TAG_subprogram ] [line [[@LINE+1]]] [union_pub_default] + // CHECK-DAG: !MDSubprogram(name: "union_pub_default",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagPrototyped, void union_pub_default(); private: - // CHECK-DAG: [ DW_TAG_member ] [union_priv] [line [[@LINE+1]]{{.*}} [private] + // CHECK-DAG: !MDDerivedType(tag: DW_TAG_member, name: "union_priv",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagPrivate) int union_priv; }; -// CHECK: {{.*}}\00256\00{{.*}} ; [ DW_TAG_subprogram ] [line [[@LINE+1]]] [def] [free] +// CHECK: !MDSubprogram(name: "free", +// CHECK-SAME: isDefinition: true +// CHECK-SAME: flags: DIFlagPrototyped, void free() {} A a; diff --git a/clang/test/CodeGenCXX/debug-info-alias.cpp b/clang/test/CodeGenCXX/debug-info-alias.cpp index dd4b00b..ffe5c75 100644 --- a/clang/test/CodeGenCXX/debug-info-alias.cpp +++ b/clang/test/CodeGenCXX/debug-info-alias.cpp @@ -13,25 +13,27 @@ bar = foo; } -// CHECK: [[BINT:![0-9]*]], {{[^,]+, [^,]+}}} ; [ DW_TAG_variable ] [bi] -// CHECK: [[BINT]] = {{.*}} ; [ DW_TAG_typedef ] [bar] [line 42 +// CHECK: !MDGlobalVariable(name: "bi",{{.*}} type: [[BINT:![0-9]+]] +// CHECK: [[BINT]] = !MDDerivedType(tag: DW_TAG_typedef, name: "bar" +// CHECK-SAME: line: 42, x::bar bi; -// CHECK: [[BFLOAT:![0-9]*]], {{[^,]+, [^,]+}}} ; [ DW_TAG_variable ] [bf] -// CHECK: [[BFLOAT]] = {{.*}} ; [ DW_TAG_typedef ] [bar] [line 42 +// CHECK: !MDGlobalVariable(name: "bf",{{.*}} type: [[BFLOAT:![0-9]+]] +// CHECK: [[BFLOAT]] = !MDDerivedType(tag: DW_TAG_typedef, name: "bar" x::bar bf; using -// CHECK: [[NARF:![0-9]*]], {{[^,]+, [^,]+}}} ; [ DW_TAG_variable ] [n] +// CHECK: !MDGlobalVariable(name: "n",{{.*}} type: [[NARF:![0-9]+]] # 142 -narf // CHECK: [[NARF]] = {{.*}} ; [ DW_TAG_typedef ] [narf] [line 142 +narf // CHECK: [[NARF]] = !MDDerivedType(tag: DW_TAG_typedef, name: "narf" +// CHECK-SAME: line: 142 = int; narf n; template using tv = void; -// CHECK: null} ; [ DW_TAG_typedef ] [tv] {{.*}} [from ] +// CHECK: !MDDerivedType(tag: DW_TAG_typedef, name: "tv" tv *tvp; using v = void; -// CHECK: null} ; [ DW_TAG_typedef ] [v] {{.*}} [from ] +// CHECK: !MDDerivedType(tag: DW_TAG_typedef, name: "v" v *vp; diff --git a/clang/test/CodeGenCXX/debug-info-anon-union-vars.cpp b/clang/test/CodeGenCXX/debug-info-anon-union-vars.cpp index 396b7e9..d75ce69d4 100644 --- a/clang/test/CodeGenCXX/debug-info-anon-union-vars.cpp +++ b/clang/test/CodeGenCXX/debug-info-anon-union-vars.cpp @@ -21,8 +21,8 @@ int test_it() { return (c == 1); } -// CHECK: [[FILE:.*]] = {{.*}}[ DW_TAG_file_type ] [{{.*}}debug-info-anon-union-vars.cpp] -// CHECK: [[FILE]]{{.*}}[ DW_TAG_variable ] [c] [line 6] [local] [def] -// CHECK: [[FILE]]{{.*}}[ DW_TAG_variable ] [d] [line 6] [local] [def] -// CHECK: [[FILE]]{{.*}}[ DW_TAG_variable ] [a] [line 6] [local] [def] -// CHECK: [[FILE]]{{.*}}[ DW_TAG_variable ] [b] [line 6] [local] [def] +// CHECK: [[FILE:.*]] = !MDFile(filename: "{{.*}}debug-info-anon-union-vars.cpp", +// CHECK: !MDGlobalVariable(name: "c",{{.*}} file: [[FILE]], line: 6,{{.*}} isLocal: true, isDefinition: true +// CHECK: !MDGlobalVariable(name: "d",{{.*}} file: [[FILE]], line: 6,{{.*}} isLocal: true, isDefinition: true +// CHECK: !MDGlobalVariable(name: "a",{{.*}} file: [[FILE]], line: 6,{{.*}} isLocal: true, isDefinition: true +// CHECK: !MDGlobalVariable(name: "b",{{.*}} file: [[FILE]], line: 6,{{.*}} isLocal: true, isDefinition: true diff --git a/clang/test/CodeGenCXX/debug-info-artificial-arg.cpp b/clang/test/CodeGenCXX/debug-info-artificial-arg.cpp index 9eb3c6f..2f03688 100644 --- a/clang/test/CodeGenCXX/debug-info-artificial-arg.cpp +++ b/clang/test/CodeGenCXX/debug-info-artificial-arg.cpp @@ -22,8 +22,12 @@ int main(int argc, char **argv) { A reallyA (500); } -// CHECK: ![[CLASSTYPE:.*]] = {{.*}}, !"_ZTS1A"} ; [ DW_TAG_class_type ] [A] -// CHECK: ![[ARTARG:.*]] = {{.*}} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [artificial] [from _ZTS1A] -// CHECK: !"_ZTS1A", {{.*}} ; [ DW_TAG_subprogram ] [line 12] [public] [A] -// CHECK: [[FUNCTYPE:![0-9]*]], null, null, null} ; [ DW_TAG_subroutine_type ] +// CHECK: ![[CLASSTYPE:.*]] = !MDCompositeType(tag: DW_TAG_class_type, name: "A", +// CHECK-SAME: identifier: "_ZTS1A" +// CHECK: ![[ARTARG:.*]] = !MDDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTS1A", +// CHECK-SAME: DIFlagArtificial +// CHECK: !MDSubprogram(name: "A", scope: !"_ZTS1A" +// CHECK-SAME: line: 12 +// CHECK-SAME: DIFlagPublic +// CHECK: !MDSubroutineType(types: [[FUNCTYPE:![0-9]*]]) // CHECK: [[FUNCTYPE]] = !{null, ![[ARTARG]], !{{.*}}, !{{.*}}} diff --git a/clang/test/CodeGenCXX/debug-info-blocks.cpp b/clang/test/CodeGenCXX/debug-info-blocks.cpp index 5b20db5..608a273 100644 --- a/clang/test/CodeGenCXX/debug-info-blocks.cpp +++ b/clang/test/CodeGenCXX/debug-info-blocks.cpp @@ -10,5 +10,9 @@ void test() { __block A a; } -// CHECK: [ DW_TAG_subprogram ] [line 10] [local] [def] [__Block_byref_object_copy_] -// CHECK: [ DW_TAG_subprogram ] [line 10] [local] [def] [__Block_byref_object_dispose_] +// CHECK: !MDSubprogram(name: "__Block_byref_object_copy_", +// CHECK-SAME: line: 10, +// CHECK-SAME: isLocal: true, isDefinition: true +// CHECK: !MDSubprogram(name: "__Block_byref_object_dispose_", +// CHECK-SAME: line: 10, +// CHECK-SAME: isLocal: true, isDefinition: true diff --git a/clang/test/CodeGenCXX/debug-info-char16.cpp b/clang/test/CodeGenCXX/debug-info-char16.cpp index e6e2f15..c2606d4 100644 --- a/clang/test/CodeGenCXX/debug-info-char16.cpp +++ b/clang/test/CodeGenCXX/debug-info-char16.cpp @@ -3,4 +3,5 @@ // 16 is DW_ATE_UTF (0x10) encoding attribute. char16_t char_a = u'h'; -// CHECK: !{{.*}} = {{.*}} ; [ DW_TAG_base_type ] [char16_t] +// CHECK: !{{.*}} = !MDBasicType(name: "char16_t" +// CHECK-SAME: encoding: DW_ATE_UTF) diff --git a/clang/test/CodeGenCXX/debug-info-class-nolimit.cpp b/clang/test/CodeGenCXX/debug-info-class-nolimit.cpp index 7a6ee4d..042794c 100644 --- a/clang/test/CodeGenCXX/debug-info-class-nolimit.cpp +++ b/clang/test/CodeGenCXX/debug-info-class-nolimit.cpp @@ -6,7 +6,9 @@ namespace rdar14101097_1 { // see also PR16214 // Check that we emit debug info for the definition of a struct if the // definition is available, even if it's used via a pointer wrapped in a // typedef. -// CHECK: [ DW_TAG_structure_type ] [foo] {{.*}}[def] +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "foo" +// CHECK-NOT: DIFlagFwdDecl +// CHECK-SAME: ){{$}} struct foo { }; @@ -21,7 +23,9 @@ namespace rdar14101097_2 { // As above, except trickier because we first encounter only a declaration of // the type and no debug-info related use after we see the definition of the // type. -// CHECK: [ DW_TAG_structure_type ] [foo] {{.*}}[def] +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "foo" +// CHECK-NOT: DIFlagFwdDecl +// CHECK-SAME: ){{$}} struct foo; void bar() { foo *f; diff --git a/clang/test/CodeGenCXX/debug-info-class.cpp b/clang/test/CodeGenCXX/debug-info-class.cpp index 55d5653..b4f88ea 100644 --- a/clang/test/CodeGenCXX/debug-info-class.cpp +++ b/clang/test/CodeGenCXX/debug-info-class.cpp @@ -90,33 +90,63 @@ int main(int argc, char **argv) { // CHECK: invoke {{.+}} @_ZN1BD1Ev(%class.B* %b) // CHECK-NEXT: unwind label %{{.+}}, !dbg ![[EXCEPTLOC:.*]] // CHECK: store i32 0, i32* %{{.+}}, !dbg ![[RETLOC:.*]] -// CHECK: DW_TAG_structure_type ] [foo] -// CHECK: DW_TAG_class_type ] [bar] -// CHECK: DW_TAG_union_type ] [baz] -// CHECK: DW_TAG_class_type ] [B] {{.*}} [def] -// CHECK: !"0xd\00_vptr$B\00{{.*}}\0064", {{.*}} ; [ DW_TAG_member ] - -// CHECK: [[C:![0-9]*]] = {{.*}} [[C_MEM:![0-9]*]], !"_ZTS1C", null, !"_ZTS1C"} ; [ DW_TAG_structure_type ] [C] {{.*}} [def] +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "foo" +// CHECK: !MDCompositeType(tag: DW_TAG_class_type, name: "bar" +// CHECK: !MDCompositeType(tag: DW_TAG_union_type, name: "baz" +// CHECK: !MDCompositeType(tag: DW_TAG_class_type, name: "B" +// CHECK-NOT: DIFlagFwdDecl +// CHECK-SAME: ){{$}} +// CHECK: !MDDerivedType(tag: DW_TAG_member, name: "_vptr$B", +// CHECK-SAME: DIFlagArtificial + +// CHECK: ![[INT:[0-9]+]] = !MDBasicType(name: "int" + +// CHECK: [[C:![0-9]*]] = !MDCompositeType(tag: DW_TAG_structure_type, name: "C", +// CHECK-NOT: DIFlagFwdDecl +// CHECK-SAME: elements: [[C_MEM:![0-9]*]] +// CHECK-SAME: vtableHolder: !"_ZTS1C" +// CHECK-SAME: identifier: "_ZTS1C" // CHECK: [[C_MEM]] = !{[[C_VPTR:![0-9]*]], [[C_S:![0-9]*]], [[C_DTOR:![0-9]*]]} -// CHECK: [[C_VPTR]] = {{.*}} ; [ DW_TAG_member ] [_vptr$C] {{.*}} [artificial] -// CHECK: [[C_S]] = {{.*}} ; [ DW_TAG_member ] [s] {{.*}} [static] [from int] -// CHECK: [[C_DTOR]] = {{.*}} ; [ DW_TAG_subprogram ] {{.*}} [~C] - -// CHECK: null, null, null, !"_ZTS1D"} ; [ DW_TAG_structure_type ] [D] {{.*}} [decl] -// CHECK: null, null, null, !"_ZTS1E"} ; [ DW_TAG_structure_type ] [E] {{.*}} [decl] -// CHECK: [[F:![0-9]*]] = {{.*}} null, null, null, !"_ZTS1F"} ; [ DW_TAG_structure_type ] [F] {{.*}} [decl] - -// CHECK: null, null, null, !"_ZTS1G"} ; [ DW_TAG_structure_type ] [G] {{.*}} [decl] -// CHECK: [[G_INNER_MEM:![0-9]*]], null, null, !"_ZTSN1G5innerE"} ; [ DW_TAG_structure_type ] [inner] [line 50, {{.*}} [def] +// CHECK: [[C_VPTR]] = !MDDerivedType(tag: DW_TAG_member, name: "_vptr$C" +// CHECK-SAME: DIFlagArtificial +// CHECK: [[C_S]] = !MDDerivedType(tag: DW_TAG_member, name: "s" +// CHECK-SAME: baseType: ![[INT]] +// CHECK-SAME: DIFlagStaticMember +// CHECK: [[C_DTOR]] = !MDSubprogram(name: "~C" + +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "D" +// CHECK-SAME: DIFlagFwdDecl +// CHECK-SAME: identifier: "_ZTS1D" +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "E" +// CHECK-SAME: DIFlagFwdDecl +// CHECK-SAME: identifier: "_ZTS1E" +// CHECK: [[F:![0-9]*]] = !MDCompositeType(tag: DW_TAG_structure_type, name: "F" +// CHECK-SAME: DIFlagFwdDecl +// CHECK-SAME: identifier: "_ZTS1F" + +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "G" +// CHECK-SAME: DIFlagFwdDecl +// CHECK-SAME: identifier: "_ZTS1G" +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "inner" +// CHECK: line: 50 +// CHECK-NOT: DIFlagFwdDecl +// CHECK-SAME: elements: [[G_INNER_MEM:![0-9]*]] +// CHECK-SAME: identifier: "_ZTSN1G5innerE" // CHECK: [[G_INNER_MEM]] = !{[[G_INNER_I:![0-9]*]]} -// CHECK: [[G_INNER_I]] = {{.*}} ; [ DW_TAG_member ] [j] {{.*}} [from int] - -// CHECK: ; [ DW_TAG_structure_type ] [A] -// CHECK: HdrSize -// CHECK: ; [ DW_TAG_structure_type ] [I] {{.*}} [def] +// CHECK: [[G_INNER_I]] = !MDDerivedType(tag: DW_TAG_member, name: "j" +// CHECK-SAME: baseType: ![[INT]] + +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "A" +// CHECK: !MDDerivedType(tag: DW_TAG_member, name: "HdrSize" +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "I" +// CHECK-NOT: DIFlagFwdDecl +// CHECK-SAME: ){{$}} // -// CHECK: !"_ZTS1D", {{.*}}, [[D_FUNC_DECL:![0-9]*]], {{![0-9]*}}} ; [ DW_TAG_subprogram ] {{.*}} [def] [func] -// CHECK: [[D_FUNC_DECL]] = !{!"0x2e\00func\00{{.*}}\000\00{{[0-9]+}}"{{.*}}, !"_ZTS1D", {{.*}}, null} ; [ DW_TAG_subprogram ] {{.*}} [func] +// CHECK: !MDSubprogram(name: "func",{{.*}} scope: !"_ZTS1D" +// CHECK-SAME: isDefinition: true +// CHECK-SAME: declaration: [[D_FUNC_DECL:![0-9]*]] +// CHECK: [[D_FUNC_DECL]] = !MDSubprogram(name: "func",{{.*}} scope: !"_ZTS1D" +// CHECK-SAME: isDefinition: false // CHECK: ![[EXCEPTLOC]] = !MDLocation(line: 84, // CHECK: ![[RETLOC]] = !MDLocation(line: 83, diff --git a/clang/test/CodeGenCXX/debug-info-cxx1y.cpp b/clang/test/CodeGenCXX/debug-info-cxx1y.cpp index 261f965..cd75fcd 100644 --- a/clang/test/CodeGenCXX/debug-info-cxx1y.cpp +++ b/clang/test/CodeGenCXX/debug-info-cxx1y.cpp @@ -1,13 +1,20 @@ // RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm-only -std=c++14 -emit-llvm -g %s -o - | FileCheck %s // CHECK: [[EMPTY:![0-9]*]] = !{} -// CHECK: \00foo\00{{.*}}, [[EMPTY]], {{.*}}} ; [ DW_TAG_structure_type ] +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "foo", +// CHECK-SAME: elements: [[EMPTY]] // FIXME: The context of this definition should be the CU/file scope, not the class. -// CHECK: !"_ZTS3foo", [[SUBROUTINE_TYPE:![0-9]*]], {{.*}}, [[FUNC_DECL:![0-9]*]], {{![0-9]*}}} ; [ DW_TAG_subprogram ] {{.*}} [def] [func] -// CHECK: [[SUBROUTINE_TYPE]] = {{.*}}, [[TYPE_LIST:![0-9]*]], +// CHECK: !MDSubprogram(name: "func", {{.*}} scope: !"_ZTS3foo" +// CHECK-SAME: type: [[SUBROUTINE_TYPE:![0-9]*]] +// CHECK-SAME: isDefinition: true +// CHECK-SAME: declaration: [[FUNC_DECL:![0-9]*]] +// CHECK: [[SUBROUTINE_TYPE]] = !MDSubroutineType(types: [[TYPE_LIST:![0-9]*]]) // CHECK: [[TYPE_LIST]] = !{[[INT:![0-9]*]]} -// CHECK: [[INT]] = {{.*}} ; [ DW_TAG_base_type ] [int] -// CHECK: [[FUNC_DECL]] = {{.*}}, !"_ZTS3foo", [[SUBROUTINE_TYPE]], {{.*}}} ; [ DW_TAG_subprogram ] {{.*}} [func] +// CHECK: [[INT]] = !MDBasicType(name: "int" +// CHECK: [[FUNC_DECL]] = !MDSubprogram(name: "func", +// CHECK-SAME: scope: !"_ZTS3foo" +// CHECK-SAME: type: [[SUBROUTINE_TYPE]] +// CHECK-SAME: isDefinition: false struct foo { static auto func(); diff --git a/clang/test/CodeGenCXX/debug-info-decl-nested.cpp b/clang/test/CodeGenCXX/debug-info-decl-nested.cpp index 95d32c4..6ceb31b 100644 --- a/clang/test/CodeGenCXX/debug-info-decl-nested.cpp +++ b/clang/test/CodeGenCXX/debug-info-decl-nested.cpp @@ -17,11 +17,16 @@ class OuterClass public: InnerClass(); // Here createContextChain() generates a limited type for OuterClass. } theInnerClass; -// CHECK0: [[DECL:[0-9]+]] = {{.*}} ; [ DW_TAG_subprogram ] [line [[@LINE+1]]] [OuterClass] +// CHECK0: ![[DECL:[0-9]+]] = !MDSubprogram(name: "OuterClass" +// CHECK0-SAME: line: [[@LINE+2]] +// CHECK0-SAME: isDefinition: false OuterClass(const Foo *); // line 10 }; OuterClass::InnerClass OuterClass::theInnerClass; // This toplevel decl causes InnerClass to be generated. -// CHECK0: !"0x2e\00OuterClass\00{{.*}}\00[[@LINE+1]]"{{.*}}, ![[DECL]], {{![0-9]+}}} ; [ DW_TAG_subprogram ] [line [[@LINE+1]]] [def] [OuterClass] +// CHECK0: !MDSubprogram(name: "OuterClass" +// CHECK0-SAME: line: [[@LINE+3]] +// CHECK0-SAME: isDefinition: true +// CHECK0-SAME: declaration: ![[DECL]] OuterClass::OuterClass(const Foo *meta) { } // line 13 @@ -36,11 +41,16 @@ class OuterClass1 public: InnerClass1(); } theInnerClass1; -// CHECK1: [[DECL:[0-9]+]] = {{.*}} ; [ DW_TAG_subprogram ] [line [[@LINE+2]]] [Bar] -// CHECK1: !"0x2e\00Bar\00{{.*}}\00[[@LINE+4]]"{{.*}}, ![[DECL]], {{![0-9]+}}} ; [ DW_TAG_subprogram ] [line [[@LINE+4]]] [def] [Bar] +// CHECK1: ![[DECL:[0-9]+]] = !MDSubprogram(name: "Bar" +// CHECK1-SAME: line: [[@LINE+2]] +// CHECK1-SAME: isDefinition: false void Bar(const Foo1 *); }; OuterClass1::InnerClass1 OuterClass1::theInnerClass1; +// CHECK1: !MDSubprogram(name: "Bar" +// CHECK1-SAME: line: [[@LINE+3]] +// CHECK1-SAME: isDefinition: true +// CHECK1-SAME: declaration: ![[DECL]] void OuterClass1::Bar(const Foo1 *meta) { } @@ -54,9 +64,14 @@ class OuterClass2 public: InnerClass2(); } theInnerClass2; -// CHECK2: [[DECL:[0-9]+]] = {{.*}} ; [ DW_TAG_subprogram ] [line [[@LINE+1]]] [~OuterClass2] +// CHECK2: ![[DECL:[0-9]+]] = !MDSubprogram(name: "~OuterClass2" +// CHECK2-SAME: line: [[@LINE+2]] +// CHECK2-SAME: isDefinition: false ~OuterClass2(); // line 10 }; OuterClass2::InnerClass2 OuterClass2::theInnerClass2; -// CHECK2: !"0x2e\00~OuterClass2\00{{.*}}\00[[@LINE+1]]"{{.*}}, ![[DECL]], {{.*}}} ; [ DW_TAG_subprogram ] [line [[@LINE+1]]] [def] [~OuterClass2] +// CHECK4: !MDSubprogram(name: "~OuterClass2" +// CHECK4-SAME: line: [[@LINE+3]] +// CHECK4-SAME: isDefinition: true +// CHECK4-SAME: declaration: ![[DECL]] OuterClass2::~OuterClass2() { } diff --git a/clang/test/CodeGenCXX/debug-info-dup-fwd-decl.cpp b/clang/test/CodeGenCXX/debug-info-dup-fwd-decl.cpp index 1b9a055..c3458ae 100644 --- a/clang/test/CodeGenCXX/debug-info-dup-fwd-decl.cpp +++ b/clang/test/CodeGenCXX/debug-info-dup-fwd-decl.cpp @@ -19,6 +19,6 @@ protected: Test t; -// CHECK: ; [ DW_TAG_pointer_type ] -// CHECK: ; [ DW_TAG_structure_type ] [data] -// CHECK-NOT: ; [ DW_TAG_structure_type ] [data] +// CHECK: !MDDerivedType(tag: DW_TAG_pointer_type +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "data" +// CHECK-NOT: !MDCompositeType(tag: DW_TAG_structure_type, name: "data" diff --git a/clang/test/CodeGenCXX/debug-info-enum-class.cpp b/clang/test/CodeGenCXX/debug-info-enum-class.cpp index 28ffce0..61b502e 100644 --- a/clang/test/CodeGenCXX/debug-info-enum-class.cpp +++ b/clang/test/CodeGenCXX/debug-info-enum-class.cpp @@ -9,9 +9,29 @@ B b; C c; D d; -// CHECK: ; [ DW_TAG_enumeration_type ] [A] [line 3, size 32, align 32, offset 0] [def] [from int] -// CHECK: ; [ DW_TAG_enumeration_type ] [B] [line 4, size 64, align 64, offset 0] [def] [from long unsigned int] -// CHECK: ; [ DW_TAG_enumeration_type ] [C] [line 5, size 32, align 32, offset 0] [def] [from ] +// CHECK: !MDCompositeType(tag: DW_TAG_enumeration_type, name: "A" +// CHECK-SAME: line: 3 +// CHECK-SAME: baseType: ![[INT:[0-9]+]] +// CHECK-SAME: size: 32, align: 32 +// CHECK-NOT: offset: +// CHECK-NOT: flags: +// CHECK-SAME: ){{$}} +// CHECK: ![[INT]] = !MDBasicType(name: "int" +// CHECK: !MDCompositeType(tag: DW_TAG_enumeration_type, name: "B" +// CHECK-SAME: line: 4 +// CHECK-SAME: baseType: ![[ULONG:[0-9]+]] +// CHECK-SAME: size: 64, align: 64 +// CHECK-NOT: offset: +// CHECK-NOT: flags: +// CHECK-SAME: ){{$}} +// CHECK: ![[ULONG]] = !MDBasicType(name: "long unsigned int" +// CHECK: !MDCompositeType(tag: DW_TAG_enumeration_type, name: "C" +// CHECK-SAME: line: 5 +// CHECK-NOT: baseType: +// CHECK-SAME: size: 32, align: 32 +// CHECK-NOT: offset: +// CHECK-NOT: flags: +// CHECK-SAME: ){{$}} namespace PR14029 { // Make sure this doesn't crash/assert. @@ -29,10 +49,13 @@ namespace PR14029 { namespace test2 { // FIXME: this should just be a declaration under -fno-standalone-debug -// CHECK: !"0x4\00{{.*}}", {{[^,]*}}, [[TEST2:![0-9]*]], {{.*}}, [[TEST_ENUMS:![0-9]*]], null, null, !"_ZTSN5test21EE"} ; [ DW_TAG_enumeration_type ] [E] -// CHECK: [[TEST2]] = {{.*}} ; [ DW_TAG_namespace ] [test2] +// CHECK: !MDCompositeType(tag: DW_TAG_enumeration_type, name: "E" +// CHECK-SAME: scope: [[TEST2:![0-9]+]] +// CHECK-SAME: elements: [[TEST_ENUMS:![0-9]+]] +// CHECK-SAME: identifier: "_ZTSN5test21EE" +// CHECK: [[TEST2]] = !MDNamespace(name: "test2" // CHECK: [[TEST_ENUMS]] = !{[[TEST_E:![0-9]*]]} -// CHECK: [[TEST_E]] = !{!"0x28\00e\000"} ; [ DW_TAG_enumerator ] [e :: 0] +// CHECK: [[TEST_E]] = !MDEnumerator(name: "e", value: 0) enum E : int; void func(E *) { } @@ -41,16 +64,22 @@ enum E : int { e }; namespace test3 { // FIXME: this should just be a declaration under -fno-standalone-debug -// CHECK: !"0x4\00{{.*}}", {{[^,]*}}, [[TEST3:![0-9]*]], {{.*}}, [[TEST_ENUMS]], null, null, !"_ZTSN5test31EE"} ; [ DW_TAG_enumeration_type ] [E] -// CHECK: [[TEST3]] = {{.*}} ; [ DW_TAG_namespace ] [test3] +// CHECK: !MDCompositeType(tag: DW_TAG_enumeration_type, name: "E" +// CHECK-SAME: scope: [[TEST3:![0-9]+]] +// CHECK-SAME: elements: [[TEST_ENUMS]] +// CHECK-SAME: identifier: "_ZTSN5test31EE" +// CHECK: [[TEST3]] = !MDNamespace(name: "test3" enum E : int { e }; void func(E *) { } } namespace test4 { -// CHECK: !"0x4\00{{.*}}", {{[^,]*}}, [[TEST4:![0-9]*]], {{.*}}, [[TEST_ENUMS]], null, null, !"_ZTSN5test41EE"} ; [ DW_TAG_enumeration_type ] [E] -// CHECK: [[TEST4]] = {{.*}} ; [ DW_TAG_namespace ] [test4] +// CHECK: !MDCompositeType(tag: DW_TAG_enumeration_type, name: "E" +// CHECK-SAME: scope: [[TEST4:![0-9]+]] +// CHECK-SAME: elements: [[TEST_ENUMS]] +// CHECK-SAME: identifier: "_ZTSN5test41EE" +// CHECK: [[TEST4]] = !MDNamespace(name: "test4" enum E : int; void f1(E *) { } @@ -59,11 +88,18 @@ void f2(E) { } } -// CHECK: ; [ DW_TAG_enumeration_type ] [D] [line 6, size 16, align 16, offset 0] [decl] [from ] +// CHECK: !MDCompositeType(tag: DW_TAG_enumeration_type, name: "D" +// CHECK-SAME: line: 6 +// CHECK-SAME: size: 16, align: 16 +// CHECK-NOT: offset: +// CHECK-SAME: flags: DIFlagFwdDecl namespace test5 { -// CHECK: !"0x4\00{{.*}}", {{[^,]*}}, [[TEST5:![0-9]*]], {{.*}}, null, null, null, !"_ZTSN5test51EE"} ; [ DW_TAG_enumeration_type ] [E] -// CHECK: [[TEST5]] = {{.*}} ; [ DW_TAG_namespace ] [test5] +// CHECK: !MDCompositeType(tag: DW_TAG_enumeration_type, name: "E" +// CHECK-SAME: scope: [[TEST5:![0-9]+]] +// CHECK-SAME: flags: DIFlagFwdDecl +// CHECK-SAME: identifier: "_ZTSN5test51EE" +// CHECK: [[TEST5]] = !MDNamespace(name: "test5" enum E : int; void f1(E *) { } @@ -73,7 +109,7 @@ namespace test6 { // Ensure typedef'd enums aren't manifest by debug info generation. // This could cause "typedef changes linkage of anonymous type, but linkage was // already computed" errors. -// CHECK-NOT: test7 +// CHECK-NOT: test6 typedef enum { } E; } diff --git a/clang/test/CodeGenCXX/debug-info-enum.cpp b/clang/test/CodeGenCXX/debug-info-enum.cpp index 954f6f6..4ba8328 100644 --- a/clang/test/CodeGenCXX/debug-info-enum.cpp +++ b/clang/test/CodeGenCXX/debug-info-enum.cpp @@ -1,13 +1,17 @@ // RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -g %s -o - | FileCheck %s -// CHECK: !"0x11\00{{.*}}", {{[^,]*}}, [[ENUMS:![0-9]*]], {{.*}}} ; [ DW_TAG_compile_unit ] +// CHECK: !MDCompileUnit( +// CHECK-SAME: enums: [[ENUMS:![0-9]*]] // CHECK: [[ENUMS]] = !{[[E1:![0-9]*]], [[E2:![0-9]*]], [[E3:![0-9]*]]} namespace test1 { -// CHECK: [[E1]] = !{!"0x4\00{{.*}}", {{[^,]*}}, [[TEST1:![0-9]*]], {{.*}}, [[TEST1_ENUMS:![0-9]*]], null, null, !"_ZTSN5test11eE"} ; [ DW_TAG_enumeration_type ] [e] -// CHECK: [[TEST1]] = {{.*}} ; [ DW_TAG_namespace ] [test1] +// CHECK: [[E1]] = !MDCompositeType(tag: DW_TAG_enumeration_type, name: "e" +// CHECK-SAME: scope: [[TEST1:![0-9]*]] +// CHECK-SAME: elements: [[TEST1_ENUMS:![0-9]*]] +// CHECK-SAME: identifier: "_ZTSN5test11eE" +// CHECK: [[TEST1]] = !MDNamespace(name: "test1" // CHECK: [[TEST1_ENUMS]] = !{[[TEST1_E:![0-9]*]]} -// CHECK: [[TEST1_E]] = !{!"0x28\00E\000"} ; [ DW_TAG_enumerator ] [E :: 0] +// CHECK: [[TEST1_E]] = !MDEnumerator(name: "E", value: 0) enum e { E }; void foo() { int v = E; @@ -16,8 +20,11 @@ void foo() { namespace test2 { // rdar://8195980 -// CHECK: [[E2]] = !{!"0x4\00{{.*}}", {{[^,]*}}, [[TEST2:![0-9]*]], {{.*}}, [[TEST1_ENUMS]], null, null, !"_ZTSN5test21eE"} ; [ DW_TAG_enumeration_type ] [e] -// CHECK: [[TEST2]] = {{.*}} ; [ DW_TAG_namespace ] [test2] +// CHECK: [[E2]] = !MDCompositeType(tag: DW_TAG_enumeration_type, name: "e" +// CHECK-SAME: scope: [[TEST2:![0-9]+]] +// CHECK-SAME: elements: [[TEST1_ENUMS]] +// CHECK-SAME: identifier: "_ZTSN5test21eE" +// CHECK: [[TEST2]] = !MDNamespace(name: "test2" enum e { E }; bool func(int i) { return i == E; @@ -25,10 +32,13 @@ bool func(int i) { } namespace test3 { -// CHECK: [[E3]] = !{!"0x4\00{{.*}}", {{[^,]*}}, [[TEST3:![0-9]*]], {{.*}}, [[TEST3_ENUMS:![0-9]*]], null, null, !"_ZTSN5test31eE"} ; [ DW_TAG_enumeration_type ] [e] -// CHECK: [[TEST3]] = {{.*}} ; [ DW_TAG_namespace ] [test3] +// CHECK: [[E3]] = !MDCompositeType(tag: DW_TAG_enumeration_type, name: "e" +// CHECK-SAME: scope: [[TEST3:![0-9]*]] +// CHECK-SAME: elements: [[TEST3_ENUMS:![0-9]*]] +// CHECK-SAME: identifier: "_ZTSN5test31eE" +// CHECK: [[TEST3]] = !MDNamespace(name: "test3" // CHECK: [[TEST3_ENUMS]] = !{[[TEST3_E:![0-9]*]]} -// CHECK: [[TEST3_E]] = !{!"0x28\00E\00-1"} ; [ DW_TAG_enumerator ] [E :: -1] +// CHECK: [[TEST3_E]] = !MDEnumerator(name: "E", value: -1) enum e { E = -1 }; void func() { e x; diff --git a/clang/test/CodeGenCXX/debug-info-flex-member.cpp b/clang/test/CodeGenCXX/debug-info-flex-member.cpp index bc501c0..25dcaab 100644 --- a/clang/test/CodeGenCXX/debug-info-flex-member.cpp +++ b/clang/test/CodeGenCXX/debug-info-flex-member.cpp @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -emit-llvm -g -triple x86_64-apple-darwin %s -o - | FileCheck %s -// CHECK: !"0x21\000\00-1"} ; [ DW_TAG_subrange_type ] +// CHECK: !MDSubrange(count: -1) struct StructName { int member[]; diff --git a/clang/test/CodeGenCXX/debug-info-fn-template.cpp b/clang/test/CodeGenCXX/debug-info-fn-template.cpp index bef9fe1..f954eeb 100644 --- a/clang/test/CodeGenCXX/debug-info-fn-template.cpp +++ b/clang/test/CodeGenCXX/debug-info-fn-template.cpp @@ -10,6 +10,6 @@ T fx(XF xi) { return xi.member; } -//CHECK: XF -//CHECK: DW_TAG_template_type_parameter +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "XF" +// CHECK: !MDTemplateTypeParameter(name: "T" template int fx(XF); diff --git a/clang/test/CodeGenCXX/debug-info-function-context.cpp b/clang/test/CodeGenCXX/debug-info-function-context.cpp index a6c5a11..f332f7c 100644 --- a/clang/test/CodeGenCXX/debug-info-function-context.cpp +++ b/clang/test/CodeGenCXX/debug-info-function-context.cpp @@ -25,12 +25,12 @@ int global_namespace_variable = 1; // functions that belong to the namespace have it as a context, and the global // function has the file as a context. -// CHECK: !"0x2e\00member_function\00{{.*}}", !{{[0-9]+}}, !"_ZTS1C"{{.*}} [ DW_TAG_subprogram ] [line 11] [def] [member_function] +// CHECK: ![[FILE:[0-9]+]] = !MDFile(filename: "{{.*}}context.cpp", +// CHECK: !MDSubprogram(name: "member_function",{{.*}} scope: !"_ZTS1C",{{.*}} isDefinition: true -// CHECK: !"0x2e\00static_member_function\00{{.*}}", !{{[0-9]+}}, !"_ZTS1C"{{.*}} [ DW_TAG_subprogram ] [line 13] [def] [static_member_function] +// CHECK: !MDSubprogram(name: "static_member_function",{{.*}} scope: !"_ZTS1C",{{.*}} isDefinition: true -// CHECK: !"0x2e\00global_function\00{{[^,]+}}", !{{[0-9]+}}, [[FILE:![0-9]*]]{{.*}} [ DW_TAG_subprogram ] [line 17] [def] [global_function] -// CHECK: [[FILE]] = {{.*}} [ DW_TAG_file_type ] +// CHECK: !MDSubprogram(name: "global_function",{{.*}} scope: ![[FILE]],{{.*}} isDefinition: true -// CHECK: !"0x2e\00global_namespace_function\00{{[^,]+}}", !{{[0-9]+}}, [[NS:![0-9]*]]{{.*}} [ DW_TAG_subprogram ] [line 20] [def] [global_namespace_function] -// CHECK: [[NS]] = {{.*}} [ DW_TAG_namespace ] [ns] [line 19] +// CHECK: !MDSubprogram(name: "global_namespace_function",{{.*}} scope: ![[NS:[0-9]+]],{{.*}} isDefinition: true +// CHECK: ![[NS]] = !MDNamespace(name: "ns" diff --git a/clang/test/CodeGenCXX/debug-info-fwd-ref.cpp b/clang/test/CodeGenCXX/debug-info-fwd-ref.cpp index c479506..351dc05 100644 --- a/clang/test/CodeGenCXX/debug-info-fwd-ref.cpp +++ b/clang/test/CodeGenCXX/debug-info-fwd-ref.cpp @@ -18,7 +18,8 @@ int main(int argc, char** argv) { // Make sure we have two DW_TAG_structure_types for baz and bar and no forward // references. -// CHECK-NOT: [fwd] -// CHECK: [ DW_TAG_structure_type ] [bar] -// CHECK: [ DW_TAG_structure_type ] [baz] -// CHECK-NOT: [fwd] +// CHECK-NOT: DIFlagFwdDecl +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "bar" +// CHECK-NOT: DIFlagFwdDecl +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "baz" +// CHECK-NOT: DIFlagFwdDecl diff --git a/clang/test/CodeGenCXX/debug-info-global-ctor-dtor.cpp b/clang/test/CodeGenCXX/debug-info-global-ctor-dtor.cpp index 28b1fab..b91a047 100644 --- a/clang/test/CodeGenCXX/debug-info-global-ctor-dtor.cpp +++ b/clang/test/CodeGenCXX/debug-info-global-ctor-dtor.cpp @@ -16,12 +16,12 @@ void foo() { static A stat; } -// CHECK-NOKEXT: [ DW_TAG_subprogram ] [line 12] [local] [def] [__cxx_global_var_init] -// CHECK-NOKEXT: [ DW_TAG_subprogram ] [line 12] [local] [def] [__dtor_glob] -// CHECK-NOKEXT: [ DW_TAG_subprogram ] [line 13] [local] [def] [__cxx_global_var_init1] -// CHECK-NOKEXT: [ DW_TAG_subprogram ] [line 13] [local] [def] [__cxx_global_array_dtor] -// CHECK-NOKEXT: [ DW_TAG_subprogram ] [line 13] [local] [def] [__dtor_array] -// CHECK-NOKEXT: [ DW_TAG_subprogram ] [line 16] [local] [def] [__dtor__ZZ3foovE4stat] -// CHECK-NOKEXT: [ DW_TAG_subprogram ] [line {{.*}}] [local] [def]{{$}} +// CHECK-NOKEXT: !MDSubprogram(name: "__cxx_global_var_init",{{.*}} line: 12,{{.*}} isLocal: true, isDefinition: true +// CHECK-NOKEXT: !MDSubprogram(name: "__dtor_glob",{{.*}} line: 12,{{.*}} isLocal: true, isDefinition: true +// CHECK-NOKEXT: !MDSubprogram(name: "__cxx_global_var_init1",{{.*}} line: 13,{{.*}} isLocal: true, isDefinition: true +// CHECK-NOKEXT: !MDSubprogram(name: "__cxx_global_array_dtor",{{.*}} line: 13,{{.*}} isLocal: true, isDefinition: true +// CHECK-NOKEXT: !MDSubprogram(name: "__dtor_array",{{.*}} line: 13,{{.*}} isLocal: true, isDefinition: true +// CHECK-NOKEXT: !MDSubprogram(name: "__dtor__ZZ3foovE4stat",{{.*}} line: 16,{{.*}} isLocal: true, isDefinition: true +// CHECK-NOKEXT: !MDSubprogram({{.*}} isLocal: true, isDefinition: true -// CHECK-KEXT: [ DW_TAG_subprogram ] [line {{.*}}] [local] [def]{{$}} +// CHECK-KEXT: !MDSubprogram({{.*}} isLocal: true, isDefinition: true diff --git a/clang/test/CodeGenCXX/debug-info-global.cpp b/clang/test/CodeGenCXX/debug-info-global.cpp index 5fc61c7..d0e8cb5 100644 --- a/clang/test/CodeGenCXX/debug-info-global.cpp +++ b/clang/test/CodeGenCXX/debug-info-global.cpp @@ -10,10 +10,12 @@ int f1() { return ns::cnst + ns::cnst; } -// CHECK: !"0x11\00{{.*}}"{{.*}}, [[GLOBALS:![0-9]*]], {{![0-9]*}}} ; [ DW_TAG_compile_unit ] +// CHECK: !MDCompileUnit( +// CHECK-SAME: globals: [[GLOBALS:![0-9]*]] // CHECK: [[GLOBALS]] = !{[[CNST:![0-9]*]]} -// CHECK: [[CNST]] = !{!"0x34\00cnst\00{{.*}}", [[NS:![0-9]*]], {{[^,]+, [^,]+, [^,]+, [^,]+}}} ; [ DW_TAG_variable ] [cnst] -// CHECK: [[NS]] = {{.*}}; [ DW_TAG_namespace ] [ns] +// CHECK: [[CNST]] = !MDGlobalVariable(name: "cnst", +// CHECK-SAME: scope: [[NS:![0-9]*]] +// CHECK: [[NS]] = !MDNamespace(name: "ns" diff --git a/clang/test/CodeGenCXX/debug-info-indirect-field-decl.cpp b/clang/test/CodeGenCXX/debug-info-indirect-field-decl.cpp index 131ceba..87868eb 100644 --- a/clang/test/CodeGenCXX/debug-info-indirect-field-decl.cpp +++ b/clang/test/CodeGenCXX/debug-info-indirect-field-decl.cpp @@ -7,9 +7,18 @@ template class Foo { }; struct Bar { int i1; - // CHECK: [ DW_TAG_member ] [line [[@LINE+1]], size 32, align 32, offset 32] [from _ZTSN3BarUt_E] + // CHECK: ![[INT:[0-9]+]] = !MDBasicType(name: "int" + // CHECK: !MDDerivedType(tag: DW_TAG_member, scope: + // CHECK-SAME: line: [[@LINE+3]] + // CHECK-SAME: baseType: !"_ZTSN3BarUt_E" + // CHECK-SAME: size: 32, align: 32, offset: 32 union { - // CHECK: [ DW_TAG_member ] [i2] [line [[@LINE+1]], size 32, align 32, offset 0] [from int] + // CHECK: !MDDerivedType(tag: DW_TAG_member, name: "i2", + // CHECK-SAME: line: [[@LINE+5]] + // CHECK-SAME: baseType: ![[INT]] + // CHECK-SAME: size: 32, align: 32 + // CHECK-NOT: offset: + // CHECK-SAME: ){{$}} int i2; }; }; diff --git a/clang/test/CodeGenCXX/debug-info-limited.cpp b/clang/test/CodeGenCXX/debug-info-limited.cpp index 294d1f6..63f6bda 100644 --- a/clang/test/CodeGenCXX/debug-info-limited.cpp +++ b/clang/test/CodeGenCXX/debug-info-limited.cpp @@ -1,6 +1,8 @@ // RUN: %clang -flimit-debug-info -emit-llvm -g -S %s -o - | FileCheck %s -// CHECK: ; [ DW_TAG_class_type ] [A] {{.*}} [def] +// CHECK: !MDCompositeType(tag: DW_TAG_class_type, name: "A" +// CHECK-NOT: DIFlagFwdDecl +// CHECK-SAME: ){{$}} class A { public: int z; @@ -11,7 +13,9 @@ A *foo (A* x) { return a; } -// CHECK: ; [ DW_TAG_class_type ] [B] {{.*}} [def] +// CHECK: !MDCompositeType(tag: DW_TAG_class_type, name: "B" +// CHECK-NOT: DIFlagFwdDecl +// CHECK-SAME: ){{$}} class B { public: @@ -24,7 +28,8 @@ int baz(B *b) { } -// CHECK: ; [ DW_TAG_structure_type ] [C] {{.*}} [decl] +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "C" +// CHECK-SAME: flags: DIFlagFwdDecl struct C { }; diff --git a/clang/test/CodeGenCXX/debug-info-method.cpp b/clang/test/CodeGenCXX/debug-info-method.cpp index bb69a65..103a402 100644 --- a/clang/test/CodeGenCXX/debug-info-method.cpp +++ b/clang/test/CodeGenCXX/debug-info-method.cpp @@ -1,14 +1,16 @@ // RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -std=c++11 -g %s -o - | FileCheck %s -// CHECK: !"_ZTS1A"} ; [ DW_TAG_class_type ] [A] -// CHECK: !"{{.*}}\00_ZN1A3fooEiS_3$_0\00{{.*}}", {{.*}} [protected] -// CHECK: ![[THISTYPE:[0-9]+]] = {{.*}} ; [ DW_TAG_pointer_type ] {{.*}} [artificial] [from _ZTS1A] -// CHECK: [ DW_TAG_ptr_to_member_type ] [line {{[0-9]+}}, size {{[1-9][0-9]+}}, align -// CHECK: {{.*}}![[MEMFUNTYPE:[0-9]+]], !{{.*}}} ; [ DW_TAG_ptr_to_member_type ] {{.*}} [from ] -// CHECK: ![[MEMFUNTYPE]] = {{.*}}![[MEMFUNARGS:[0-9]+]], null, null, null} ; [ DW_TAG_subroutine_type ] {{.*}} [from ] +// CHECK: !MDCompositeType(tag: DW_TAG_class_type, name: "A",{{.*}} identifier: "_ZTS1A") +// CHECK: !MDSubprogram(name: "foo", linkageName: "_ZN1A3fooEiS_3$_0" +// CHECK-SAME: DIFlagProtected +// CHECK: ![[THISTYPE:[0-9]+]] = !MDDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTS1A" +// CHECK-SAME: DIFlagArtificial +// CHECK: !MDDerivedType(tag: DW_TAG_ptr_to_member_type +// CHECK: !MDDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: ![[MEMFUNTYPE:[0-9]+]] +// CHECK: ![[MEMFUNTYPE]] = !MDSubroutineType(types: ![[MEMFUNARGS:[0-9]+]]) // CHECK: ![[MEMFUNARGS]] = {{.*}}, ![[THISTYPE]], -// CHECK: !"0x101\00\00{{.*}}"{{.*}} DW_TAG_arg_variable -// CHECK: !"0x101\00\00{{.*}}"{{.*}} DW_TAG_arg_variable -// CHECK: !"0x101\00\00{{.*}}"{{.*}} DW_TAG_arg_variable +// CHECK: !MDLocalVariable(tag: DW_TAG_arg_variable +// CHECK: !MDLocalVariable(tag: DW_TAG_arg_variable +// CHECK: !MDLocalVariable(tag: DW_TAG_arg_variable union { int a; float b; diff --git a/clang/test/CodeGenCXX/debug-info-namespace.cpp b/clang/test/CodeGenCXX/debug-info-namespace.cpp index 60d508b..e9e55a7 100644 --- a/clang/test/CodeGenCXX/debug-info-namespace.cpp +++ b/clang/test/CodeGenCXX/debug-info-namespace.cpp @@ -55,47 +55,61 @@ void B::func_fwd() {} // This should work even if 'i' and 'func' were declarations & not definitions, // but it doesn't yet. -// CHECK: [[CU:![0-9]*]] = !{!"0x11\00{{.*}}\001"{{.*}}, [[MODULES:![0-9]*]]} ; [ DW_TAG_compile_unit ] -// CHECK: [[FOO:![0-9]*]] {{.*}} ; [ DW_TAG_structure_type ] [foo] [line 5, size 0, align 0, offset 0] [decl] [from ] -// CHECK: [[FOOCPP:![0-9]*]] = !{!"foo.cpp", {{.*}} -// CHECK: [[NS:![0-9]*]] = !{!"0x39\00B\001", [[FILE2:![0-9]*]], [[CTXT:![0-9]*]]} ; [ DW_TAG_namespace ] [B] [line 1] -// CHECK: [[CTXT]] = !{!"0x39\00A\005", [[FILE:![0-9]*]], null} ; [ DW_TAG_namespace ] [A] [line 5] -// CHECK: [[FILE]] {{.*}}debug-info-namespace.cpp" -// CHECK: [[BAR:![0-9]*]] {{.*}} ; [ DW_TAG_structure_type ] [bar] [line 6, {{.*}}] [decl] [from ] -// CHECK: [[F1:![0-9]*]] {{.*}} ; [ DW_TAG_subprogram ] [line 4] [def] [f1] -// CHECK: [[FILE2]]} ; [ DW_TAG_file_type ] [{{.*}}foo.cpp] -// CHECK: [[FUNC:![0-9]*]] {{.*}} ; [ DW_TAG_subprogram ] {{.*}} [def] [func] -// CHECK: [[FUNC_FWD:![0-9]*]] {{.*}} [ DW_TAG_subprogram ] [line 47] [def] [func_fwd] -// CHECK: [[I:![0-9]*]] = !{!"0x34\00i\00{{.*}}", [[NS]], {{.*}} ; [ DW_TAG_variable ] [i] -// CHECK: [[VAR_FWD:![0-9]*]] = !{!"0x34\00var_fwd\00{{.*}}", [[NS]], {{.*}}} ; [ DW_TAG_variable ] [var_fwd] [line 44] [def] +// CHECK: [[CU:![0-9]+]] = !MDCompileUnit( +// CHECK-SAME: imports: [[MODULES:![0-9]*]] +// CHECK: [[FOO:![0-9]+]] = !MDCompositeType(tag: DW_TAG_structure_type, name: "foo", +// CHECK-SAME: line: 5 +// CHECK-SAME: DIFlagFwdDecl +// CHECK: [[FOOCPP:![0-9]+]] = !MDFile(filename: "foo.cpp" +// CHECK: [[NS:![0-9]+]] = !MDNamespace(name: "B", scope: [[CTXT:![0-9]+]], file: [[FOOCPP]], line: 1) +// CHECK: [[CTXT]] = !MDNamespace(name: "A", scope: null, file: [[FILE:![0-9]+]], line: 5) +// CHECK: [[FILE]] = !MDFile(filename: "{{.*}}debug-info-namespace.cpp", +// CHECK: [[BAR:![0-9]+]] = !MDCompositeType(tag: DW_TAG_structure_type, name: "bar", +// CHECK-SAME: line: 6 +// CHECK-SAME: DIFlagFwdDecl +// CHECK: [[F1:![0-9]+]] = !MDSubprogram(name: "f1",{{.*}} line: 4 +// CHECK-SAME: isDefinition: true +// CHECK: [[FUNC:![0-9]+]] = !MDSubprogram(name: "func",{{.*}} isDefinition: true +// CHECK: [[FUNC_FWD:![0-9]+]] = !MDSubprogram(name: "func_fwd",{{.*}} line: 47,{{.*}} isDefinition: true +// CHECK: [[I:![0-9]+]] = !MDGlobalVariable(name: "i",{{.*}} scope: [[NS]], +// CHECK: [[VAR_FWD:![0-9]+]] = !MDGlobalVariable(name: "var_fwd",{{.*}} scope: [[NS]], +// CHECK-SAME: line: 44 +// CHECK-SAME: isDefinition: true -// CHECK: [[MODULES]] = !{[[M1:![0-9]*]], [[M2:![0-9]*]], [[M3:![0-9]*]], [[M4:![0-9]*]], [[M5:![0-9]*]], [[M6:![0-9]*]], [[M7:![0-9]*]], [[M8:![0-9]*]], [[M9:![0-9]*]], [[M10:![0-9]*]], [[M11:![0-9]*]], [[M12:![0-9]*]], [[M13:![0-9]*]], [[M14:![0-9]*]], [[M15:![0-9]*]], [[M16:![0-9]*]], [[M17:![0-9]*]]} -// CHECK: [[M1]] = !{!"0x3a\0015\00", [[CTXT]], [[NS]]} ; [ DW_TAG_imported_module ] -// CHECK: [[M2]] = !{!"0x3a\00{{[0-9]+}}\00", [[CU]], [[CTXT]]} ; [ DW_TAG_imported_module ] -// CHECK: [[M3]] = !{!"0x8\0019\00E", [[CU]], [[CTXT]]} ; [ DW_TAG_imported_declaration ] -// CHECK: [[M4]] = !{!"0x3a\0023\00", [[LEX2:![0-9]*]], [[NS]]} ; [ DW_TAG_imported_module ] -// CHECK: [[LEX2]] = !{!"0xb\00{{[0-9]*}}\000\00{{.*}}", [[FILE2]], [[LEX1:![0-9]+]]} ; [ DW_TAG_lexical_block ] -// CHECK: [[LEX1]] = !{!"0xb\00{{[0-9]*}}\000\00{{.*}}", [[FILE2]], [[FUNC]]} ; [ DW_TAG_lexical_block ] -// CHECK: [[M5]] = !{!"0x3a\00{{[0-9]+}}\00", [[FUNC]], [[CTXT]]} ; [ DW_TAG_imported_module ] -// CHECK: [[M6]] = !{!"0x8\0027\00", [[FUNC]], [[FOO:!"_ZTSN1A1B3fooE"]]} ; [ DW_TAG_imported_declaration ] -// CHECK: [[M7]] = !{!"0x8\00{{[0-9]+}}\00", [[FUNC]], [[BAR:!"_ZTSN1A1B3barE"]]} ; [ DW_TAG_imported_declaration ] -// CHECK: [[M8]] = !{!"0x8\00{{[0-9]+}}\00", [[FUNC]], [[F1]]} ; [ DW_TAG_imported_declaration ] -// CHECK: [[M9]] = !{!"0x8\00{{[0-9]+}}\00", [[FUNC]], [[I]]} ; [ DW_TAG_imported_declaration ] -// CHECK: [[M10]] = !{!"0x8\00{{[0-9]+}}\00", [[FUNC]], [[BAZ:![0-9]*]]} ; [ DW_TAG_imported_declaration ] -// CHECK: [[BAZ]] = !{!"0x16\00baz\00{{.*}}", [[FOOCPP]], [[NS]], !"_ZTSN1A1B3barE"} ; [ DW_TAG_typedef ] [baz] {{.*}} [from _ZTSN1A1B3barE] -// CHECK: [[M11]] = !{!"0x8\00{{[0-9]+}}\00X", [[FUNC]], [[CTXT]]} ; [ DW_TAG_imported_declaration ] -// CHECK: [[M12]] = !{!"0x8\00{{[0-9]+}}\00Y", [[FUNC]], [[M11]]} ; [ DW_TAG_imported_declaration ] -// CHECK: [[M13]] = !{!"0x8\00{{[0-9]+}}\00", [[FUNC]], [[VAR_DECL:![0-9]*]]} ; [ DW_TAG_imported_declaration ] -// CHECK [[VAR_DECL]] = !{!"0x34\00var_decl\00{{.*}}", [[NS]], {{.*}}} ; [ DW_TAG_variable ] [var_decl] [line 8] -// CHECK: [[M14]] = !{!"0x8\00{{[0-9]+}}\00", [[FUNC]], [[FUNC_DECL:![0-9]*]]} ; [ DW_TAG_imported_declaration ] -// CHECK: [[FUNC_DECL]] = !{!"0x2e\00func_decl\00{{.*}}", [[FOOCPP]], [[NS]], {{.*}}} ; [ DW_TAG_subprogram ] [line 9] [scope 0] [func_decl] -// CHECK: [[M15]] = !{!"0x8\00{{[0-9]+}}\00", [[FUNC]], [[VAR_FWD:![0-9]*]]} ; [ DW_TAG_imported_declaration ] -// CHECK: [[M16]] = !{!"0x8\00{{[0-9]+}}\00", [[FUNC]], [[FUNC_FWD:![0-9]*]]} ; [ DW_TAG_imported_declaration ] -// CHECK: [[M17]] = !{!"0x8\00{{[0-9]+}}\00", [[CTXT]], [[I]]} ; [ DW_TAG_imported_declaration ] -// CHECK-GMLT: [[CU:![0-9]*]] = !{!"0x11\00{{.*}}\002"{{.*}}, [[MODULES:![0-9]*]]} ; [ DW_TAG_compile_unit ] +// CHECK: [[MODULES]] = !{[[M1:![0-9]+]], [[M2:![0-9]+]], [[M3:![0-9]+]], [[M4:![0-9]+]], [[M5:![0-9]+]], [[M6:![0-9]+]], [[M7:![0-9]+]], [[M8:![0-9]+]], [[M9:![0-9]+]], [[M10:![0-9]+]], [[M11:![0-9]+]], [[M12:![0-9]+]], [[M13:![0-9]+]], [[M14:![0-9]+]], [[M15:![0-9]+]], [[M16:![0-9]+]], [[M17:![0-9]+]]} +// CHECK: [[M1]] = !MDImportedEntity(tag: DW_TAG_imported_module, scope: [[CTXT]], entity: [[NS]], line: 15) +// CHECK: [[M2]] = !MDImportedEntity(tag: DW_TAG_imported_module, scope: [[CU]], entity: [[CTXT]], +// CHECK: [[M3]] = !MDImportedEntity(tag: DW_TAG_imported_declaration, name: "E", scope: [[CU]], entity: [[CTXT]], line: 19) +// CHECK: [[M4]] = !MDImportedEntity(tag: DW_TAG_imported_module, scope: [[LEX2:![0-9]+]], entity: [[NS]], line: 23) +// CHECK: [[LEX2]] = distinct !MDLexicalBlock(scope: [[LEX1:![0-9]+]], file: [[FOOCPP]], +// CHECK: [[LEX1]] = distinct !MDLexicalBlock(scope: [[FUNC]], file: [[FOOCPP]], +// CHECK: [[M5]] = !MDImportedEntity(tag: DW_TAG_imported_module, scope: [[FUNC]], entity: [[CTXT]], +// CHECK: [[M6]] = !MDImportedEntity(tag: DW_TAG_imported_declaration, scope: [[FUNC]], entity: [[FOO:!"_ZTSN1A1B3fooE"]], line: 27) +// CHECK: [[M7]] = !MDImportedEntity(tag: DW_TAG_imported_declaration, scope: [[FUNC]], entity: [[BAR:!"_ZTSN1A1B3barE"]] +// CHECK: [[M8]] = !MDImportedEntity(tag: DW_TAG_imported_declaration, scope: [[FUNC]], entity: [[F1]] +// CHECK: [[M9]] = !MDImportedEntity(tag: DW_TAG_imported_declaration, scope: [[FUNC]], entity: [[I]] +// CHECK: [[M10]] = !MDImportedEntity(tag: DW_TAG_imported_declaration, scope: [[FUNC]], entity: [[BAZ:![0-9]+]] +// CHECK: [[BAZ]] = !MDDerivedType(tag: DW_TAG_typedef, name: "baz", scope: [[NS]], file: [[FOOCPP]], +// CHECK-SAME: baseType: !"_ZTSN1A1B3barE" +// CHECK: [[M11]] = !MDImportedEntity(tag: DW_TAG_imported_declaration, name: "X", scope: [[FUNC]], entity: [[CTXT]] +// CHECK: [[M12]] = !MDImportedEntity(tag: DW_TAG_imported_declaration, name: "Y", scope: [[FUNC]], entity: [[M11]] +// CHECK: [[M13]] = !MDImportedEntity(tag: DW_TAG_imported_declaration, scope: [[FUNC]], entity: [[VAR_DECL:![0-9]+]] +// CHECK [[VAR_DECL]] = !MDGlobalVariable(name: "var_decl", scope: [[NS]],{{.*}} line: 8, +// CHECK: [[M14]] = !MDImportedEntity(tag: DW_TAG_imported_declaration, scope: [[FUNC]], entity: [[FUNC_DECL:![0-9]+]] +// CHECK: [[FUNC_DECL]] = !MDSubprogram(name: "func_decl", +// CHECK-SAME: scope: [[NS]], file: [[FOOCPP]], line: 9 +// CHECK: [[M15]] = !MDImportedEntity(tag: DW_TAG_imported_declaration, scope: [[FUNC]], entity: [[VAR_FWD:![0-9]+]] +// CHECK: [[M16]] = !MDImportedEntity(tag: DW_TAG_imported_declaration, scope: [[FUNC]], entity: [[FUNC_FWD:![0-9]+]] +// CHECK: [[M17]] = !MDImportedEntity(tag: DW_TAG_imported_declaration, scope: [[CTXT]], entity: [[I]] + +// CHECK-GMLT: [[CU:![0-9]+]] = !MDCompileUnit( +// CHECK-GMLT-SAME: emissionKind: 2, +// CHECK-GMLT-SAME: imports: [[MODULES:![0-9]+]] // CHECK-GMLT: [[MODULES]] = !{} -// CHECK-NOLIMIT: ; [ DW_TAG_structure_type ] [bar] [line 6, {{.*}}] [def] [from ] +// CHECK-NOLIMIT: !MDCompositeType(tag: DW_TAG_structure_type, name: "bar",{{.*}} line: 6, +// CHECK-NOLIMIT-NOT: DIFlagFwdDecl +// CHECK-NOLIMIT-SAME: ){{$}} // REQUIRES: shell-preserves-root // REQUIRES: dw2 diff --git a/clang/test/CodeGenCXX/debug-info-nullptr.cpp b/clang/test/CodeGenCXX/debug-info-nullptr.cpp index ef9b618..4816626 100644 --- a/clang/test/CodeGenCXX/debug-info-nullptr.cpp +++ b/clang/test/CodeGenCXX/debug-info-nullptr.cpp @@ -4,4 +4,4 @@ void foo() { decltype(nullptr) t = 0; } -// CHECK: [ DW_TAG_unspecified_type ] [decltype(nullptr)] +// CHECK: !MDBasicType(tag: DW_TAG_unspecified_type, name: "decltype(nullptr)") 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 656e6f4..90a6614 100644 --- a/clang/test/CodeGenCXX/debug-info-ptr-to-member-function.cpp +++ b/clang/test/CodeGenCXX/debug-info-ptr-to-member-function.cpp @@ -7,4 +7,5 @@ struct T { void foo(int (T::*method)()) {} // A pointer to a member function is a pair of function- and this-pointer. -// CHECK: [ DW_TAG_ptr_to_member_type ] {{.*}} size 128 +// CHECK: !MDDerivedType(tag: DW_TAG_ptr_to_member_type, +// CHECK-SAME: size: 128 diff --git a/clang/test/CodeGenCXX/debug-info-qualifiers.cpp b/clang/test/CodeGenCXX/debug-info-qualifiers.cpp index 2655bd9..8d3394c 100644 --- a/clang/test/CodeGenCXX/debug-info-qualifiers.cpp +++ b/clang/test/CodeGenCXX/debug-info-qualifiers.cpp @@ -2,25 +2,35 @@ // Test (r)value and CVR qualifiers on C++11 non-static member functions. class A { public: - // CHECK: !"0x2e\00l\00{{.*}}\00[[@LINE+2]]"{{, [^,]+, [^,]+}}, ![[PLSR:[0-9]+]], {{.*}}[ DW_TAG_subprogram ] [line [[@LINE+2]]] [public] [reference] [l] - // CHECK: ![[PLSR]] ={{.*}}[ DW_TAG_subroutine_type ]{{.*}}[reference] + // CHECK: !MDSubprogram(name: "l", + // CHECK-SAME: line: [[@LINE+4]] + // CHECK-SAME: type: ![[PLSR:[0-9]+]] + // CHECK-SAME: flags: DIFlagPublic | DIFlagPrototyped | DIFlagLValueReference, + // CHECK: ![[PLSR]] = !MDSubroutineType(flags: DIFlagLValueReference, types: ![[ARGS:[0-9]+]]) void l() const &; - // CHECK: ![[ARGS:[0-9]+]] = !{null, ![[THIS:[0-9]+]]} - // CHECK: ![[THIS]] = {{.*}} ![[CONST_A:.*]]} ; [ DW_TAG_pointer_type ] - // CHECK: ![[CONST_A]] = {{.*}} [ DW_TAG_const_type ] - // CHECK: !"0x2e\00r\00{{.*}}\00[[@LINE+2]]"{{, [^,]+, [^,]+}}, ![[PRSR:[0-9]+]], {{.*}}[ DW_TAG_subprogram ] [line [[@LINE+2]]] [public] [rvalue reference] [r] - // CHECK: ![[PRSR]] ={{.*}}![[ARGS]], null, null, null}{{.*}}[ DW_TAG_subroutine_type ]{{.*}}[rvalue reference] + // CHECK: ![[ARGS]] = !{null, ![[THIS:[0-9]+]]} + // CHECK: ![[THIS]] = !MDDerivedType(tag: DW_TAG_pointer_type, baseType: ![[CONST_A:[0-9]+]] + // CHECK: ![[CONST_A]] = !MDDerivedType(tag: DW_TAG_const_type + // CHECK: !MDSubprogram(name: "r" + // CHECK-SAME: line: [[@LINE+4]] + // CHECK-SAME: type: ![[PRSR:[0-9]+]] + // CHECK-SAME: flags: DIFlagPublic | DIFlagPrototyped | DIFlagRValueReference, + // CHECK: ![[PRSR]] = !MDSubroutineType(flags: DIFlagRValueReference, types: ![[ARGS]]) void r() const &&; }; void g() { A a; // The type of pl is "void (A::*)() const &". - // CHECK: ![[PL:[0-9]+]]} ; [ DW_TAG_auto_variable ] [pl] [line [[@LINE+2]]] - // CHECK: ![[PLSR]], !"{{.*}}"} ; [ DW_TAG_ptr_to_member_type ] + // CHECK: !MDLocalVariable(tag: DW_TAG_auto_variable, name: "pl", + // CHECK-SAME: line: [[@LINE+3]] + // CHECK-SAME: type: ![[PL:[0-9]+]] + // CHECK: !MDDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: ![[PLSR]] auto pl = &A::l; - // CHECK: ![[PR:[0-9]+]]} ; [ DW_TAG_auto_variable ] [pr] [line [[@LINE+2]]] - // CHECK: ![[PRSR]], !"{{.*}}"} ; [ DW_TAG_ptr_to_member_type ] + // CHECK: !MDLocalVariable(tag: DW_TAG_auto_variable, name: "pr", + // CHECK-SAME: line: [[@LINE+3]] + // CHECK-SAME: type: ![[PR:[0-9]+]] + // CHECK: !MDDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: ![[PRSR]] auto pr = &A::r; } diff --git a/clang/test/CodeGenCXX/debug-info-rvalue-ref.cpp b/clang/test/CodeGenCXX/debug-info-rvalue-ref.cpp index 36e4aa3..797e170 100644 --- a/clang/test/CodeGenCXX/debug-info-rvalue-ref.cpp +++ b/clang/test/CodeGenCXX/debug-info-rvalue-ref.cpp @@ -8,4 +8,5 @@ void foo (int &&i) printf("%d\n", i); } -// CHECK: !"0x42\00\000\000\000\000\000", null, null, !{{.*}}} ; [ DW_TAG_rvalue_reference_type ] +// CHECK: !MDDerivedType(tag: DW_TAG_rvalue_reference_type, baseType: ![[INT:[0-9]+]]) +// CHECK: ![[INT]] = !MDBasicType(name: "int" diff --git a/clang/test/CodeGenCXX/debug-info-scope.cpp b/clang/test/CodeGenCXX/debug-info-scope.cpp index e66588d..9221ff7 100644 --- a/clang/test/CodeGenCXX/debug-info-scope.cpp +++ b/clang/test/CodeGenCXX/debug-info-scope.cpp @@ -9,47 +9,64 @@ int src(); void f(); void func() { - // CHECK: = !{!"0x100\00{{.*}}", [[IF1:![0-9]*]], {{.*}} ; [ DW_TAG_auto_variable ] [i] [line [[@LINE+2]]] - // CHECK: [[IF1]] = !{!"0xb\00[[@LINE+1]]\00{{.*}}", !{{.*}}} ; [ DW_TAG_lexical_block ] + // CHECK: = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "i" + // CHECK-SAME: scope: [[IF1:![0-9]*]] + // CHECK-SAME: line: [[@LINE+2]] + // CHECK: [[IF1]] = distinct !MDLexicalBlock({{.*}}line: [[@LINE+1]]) if (int i = src()) f(); - // CHECK: = !{!"0x100\00{{.*}}", [[IF2:![0-9]*]], {{.*}} ; [ DW_TAG_auto_variable ] [i] [line [[@LINE+2]]] - // CHECK: [[IF2]] = !{!"0xb\00[[@LINE+1]]\00{{.*}}", !{{.*}}} ; [ DW_TAG_lexical_block ] + // CHECK: = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "i" + // CHECK-SAME: scope: [[IF2:![0-9]*]] + // CHECK-SAME: line: [[@LINE+2]] + // CHECK: [[IF2]] = distinct !MDLexicalBlock({{.*}}line: [[@LINE+1]]) if (int i = src()) { f(); } else f(); - // CHECK: = !{!"0x100\00{{.*}}", [[FOR:![0-9]*]], {{.*}} ; [ DW_TAG_auto_variable ] [i] [line [[@LINE+2]]] - // CHECK: [[FOR]] = !{!"0xb\00[[@LINE+1]]\00{{.*}}", !{{.*}}} ; [ DW_TAG_lexical_block ] + // CHECK: = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "i" + // CHECK-SAME: scope: [[FOR:![0-9]*]] + // CHECK-SAME: line: [[@LINE+2]] + // CHECK: [[FOR]] = distinct !MDLexicalBlock({{.*}}line: [[@LINE+1]]) for (int i = 0; - // CHECK: = !{!"0x100\00{{.*}}", [[FOR_BODY:![0-9]*]], {{.*}} ; [ DW_TAG_auto_variable ] [b] [line [[@LINE+6]]] + // CHECK: = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "b" + // CHECK-SAME: scope: [[FOR_BODY:![0-9]*]] + // CHECK-SAME: line: [[@LINE+6]] + // CHECK: [[FOR_BODY]] = distinct !MDLexicalBlock({{.*}}line: [[@LINE-4]]) // The scope could be located at 'bool b', but LLVM drops line information for // scopes anyway, so it's not terribly important. // FIXME: change the debug info schema to not include locations of scopes, // since they're not used. - // CHECK: [[FOR_BODY]] = !{!"0xb\00[[@LINE-6]]\00{{.*}}", !{{.*}}} ; [ DW_TAG_lexical_block ] bool b = i != 10; ++i) f(); - // CHECK: = !{!"0x100\00{{.*}}", [[FOR:![0-9]*]], {{.*}} ; [ DW_TAG_auto_variable ] [i] [line [[@LINE+2]]] - // CHECK: [[FOR]] = !{!"0xb\00[[@LINE+1]]\00{{.*}}", !{{.*}}} ; [ DW_TAG_lexical_block ] + // CHECK: = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "i" + // CHECK-SAME: scope: [[FOR:![0-9]*]] + // CHECK-SAME: line: [[@LINE+2]] + // CHECK: [[FOR]] = distinct !MDLexicalBlock({{.*}}line: [[@LINE+1]]) for (int i = 0; i != 10; ++i) { // FIXME: Do not include scopes that have only other scopes (and no variables // or using declarations) as direct children, they just waste // space/relocations/etc. - // CHECK: [[FOR_LOOP_INCLUDING_COND:!.*]] = !{!"0xb\00[[@LINE-4]]\00{{.*}}", !{{[0-9]+}}, [[FOR]]} ; [ DW_TAG_lexical_block ] - // CHECK: = !{!"0x100\00{{.*}}", [[FOR_COMPOUND:![0-9]*]], {{.*}} ; [ DW_TAG_auto_variable ] [b] [line [[@LINE+2]]] - // CHECK: [[FOR_COMPOUND]] = !{!"0xb\00[[@LINE-6]]\00{{.*}}", !{{[0-9]+}}, [[FOR_LOOP_INCLUDING_COND]]} ; [ DW_TAG_lexical_block ] + // CHECK: [[FOR_LOOP_INCLUDING_COND:!.*]] = distinct !MDLexicalBlock(scope: [[FOR]],{{.*}} line: [[@LINE-4]]) + // CHECK: = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "b" + // CHECK-SAME: scope: [[FOR_COMPOUND:![0-9]*]] + // CHECK-SAME: line: [[@LINE+2]] + // CHECK: [[FOR_COMPOUND]] = distinct !MDLexicalBlock(scope: [[FOR_LOOP_INCLUDING_COND]],{{.*}} line: [[@LINE-8]]) bool b = i % 2; } int x[] = {1, 2}; - // CHECK: = !{!"0x100\00{{.*}}", [[RANGE_FOR:![0-9]*]], {{.*}} ; [ DW_TAG_auto_variable ] [__range] [line 0] - // CHECK: [[RANGE_FOR]] = !{!"0xb\00[[@LINE+1]]\00{{.*}}", !{{.*}}} ; [ DW_TAG_lexical_block ] + // CHECK: = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "__range" + // CHECK-SAME: scope: [[RANGE_FOR:![0-9]*]] + // CHECK-NOT: line: + // CHECK-SAME: ){{$}} + // CHECK: [[RANGE_FOR]] = distinct !MDLexicalBlock({{.*}}, line: [[@LINE+1]]) for (int i : x) { - // CHECK: = !{!"0x100\00{{.*}}", [[RANGE_FOR_BODY:![0-9]*]], {{.*}} ; [ DW_TAG_auto_variable ] [i] [line [[@LINE-1]]] - // CHECK: [[RANGE_FOR_BODY]] = !{!"0xb\00[[@LINE-2]]\00{{.*}}", !{{[0-9]+}}, [[RANGE_FOR]]} ; [ DW_TAG_lexical_block ] + // CHECK: = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "i" + // CHECK-SAME: scope: [[RANGE_FOR_BODY:![0-9]*]] + // CHECK-SAME: line: [[@LINE-3]] + // CHECK: [[RANGE_FOR_BODY]] = distinct !MDLexicalBlock(scope: [[RANGE_FOR]],{{.*}} line: [[@LINE-4]]) } } diff --git a/clang/test/CodeGenCXX/debug-info-static-fns.cpp b/clang/test/CodeGenCXX/debug-info-static-fns.cpp index 41b713c..f9d13b7 100644 --- a/clang/test/CodeGenCXX/debug-info-static-fns.cpp +++ b/clang/test/CodeGenCXX/debug-info-static-fns.cpp @@ -7,4 +7,7 @@ namespace A { } // Verify that a is present and mangled. -// CHECK: !"0x2e\00a\00a\00_ZN1AL1aEi\00{{.*}}", {{.*}}, i32 (i32)* @_ZN1AL1aEi, {{.*}} ; [ DW_TAG_subprogram ] [line 4] [local] [def] [a] +// CHECK: !MDSubprogram(name: "a", linkageName: "_ZN1AL1aEi", +// CHECK-SAME: line: 4 +// CHECK-SAME: isDefinition: true +// CHECK-SAME: function: i32 (i32)* @_ZN1AL1aEi diff --git a/clang/test/CodeGenCXX/debug-info-static-member.cpp b/clang/test/CodeGenCXX/debug-info-static-member.cpp index 18fd691..26f60b3 100644 --- a/clang/test/CodeGenCXX/debug-info-static-member.cpp +++ b/clang/test/CodeGenCXX/debug-info-static-member.cpp @@ -33,20 +33,57 @@ int main() // why the definition of "a" comes before the declarations while // "b" and "c" come after. -// CHECK: !"_ZTS1X"} ; [ DW_TAG_enumeration_type ] [X] -// CHECK: !"_ZTS1C"} ; [ DW_TAG_class_type ] [C] -// CHECK: ![[DECL_A:[0-9]+]] = {{.*}} [ DW_TAG_member ] [a] [line {{.*}}, size 0, align 0, offset 0] [static] -// CHECK: !"0xd\00const_a\00{{.*}}", {{.*}}, i1 true} ; [ DW_TAG_member ] [const_a] [line {{.*}}, size 0, align 0, offset 0] [static] -// CHECK: ![[DECL_B:[0-9]+]] = !{!"0xd\00b\00{{.*}}", {{.*}} [ DW_TAG_member ] [b] [line {{.*}}, size 0, align 0, offset 0] [protected] [static] -// CHECK: !"0xd\00const_b\00{{.*}}", {{.*}}, float 0x{{.*}}} ; [ DW_TAG_member ] [const_b] [line {{.*}}, size 0, align 0, offset 0] [protected] [static] -// CHECK: ![[DECL_C:[0-9]+]] = !{!"0xd\00c\00{{.*}}", {{.*}} [ DW_TAG_member ] [c] [line {{.*}}, size 0, align 0, offset 0] [public] [static] -// CHECK: !"0xd\00const_c\00{{.*}}", {{.*}} [ DW_TAG_member ] [const_c] [line {{.*}}, size 0, align 0, offset 0] [public] [static] -// CHECK: !"0xd\00x_a\00{{.*}}", {{.*}} [ DW_TAG_member ] [x_a] {{.*}} [public] [static] - -// CHECK: ; [ DW_TAG_structure_type ] [static_decl_templ] {{.*}} [def] -// CHECK: ; [ DW_TAG_member ] [static_decl_templ_var] - -// CHECK: [[NS_X:![0-9]+]] = {{.*}} ; [ DW_TAG_namespace ] [x] +// CHECK: !MDCompositeType(tag: DW_TAG_enumeration_type, name: "X"{{.*}}, identifier: "_ZTS1X") +// CHECK: !MDCompositeType(tag: DW_TAG_class_type, name: "C"{{.*}}, identifier: "_ZTS1C") +// +// CHECK: ![[DECL_A:[0-9]+]] = !MDDerivedType(tag: DW_TAG_member, name: "a" +// CHECK-NOT: size: +// CHECK-NOT: align: +// CHECK-NOT: offset: +// CHECK-SAME: flags: DIFlagStaticMember) +// +// CHECK: !MDDerivedType(tag: DW_TAG_member, name: "const_a" +// CHECK-NOT: size: +// CHECK-NOT: align: +// CHECK-NOT: offset: +// CHECK-SAME: flags: DIFlagStaticMember, +// CHECK-SAME: extraData: i1 true) +// +// CHECK: ![[DECL_B:[0-9]+]] = !MDDerivedType(tag: DW_TAG_member, name: "b" +// CHECK-NOT: size: +// CHECK-NOT: align: +// CHECK-NOT: offset: +// CHECK-SAME: flags: DIFlagProtected | DIFlagStaticMember) +// +// CHECK: !MDDerivedType(tag: DW_TAG_member, name: "const_b" +// CHECK-NOT: size: +// CHECK-NOT: align: +// CHECK-NOT: offset: +// CHECK-SAME: flags: DIFlagProtected | DIFlagStaticMember, +// CHECK-SAME: extraData: float 0x{{.*}}) +// +// CHECK: ![[DECL_C:[0-9]+]] = !MDDerivedType(tag: DW_TAG_member, name: "c" +// CHECK-NOT: size: +// CHECK-NOT: align: +// CHECK-NOT: offset: +// CHECK-SAME: flags: DIFlagPublic | DIFlagStaticMember) +// +// CHECK: !MDDerivedType(tag: DW_TAG_member, name: "const_c" +// CHECK-NOT: size: +// CHECK-NOT: align: +// CHECK-NOT: offset: +// CHECK-SAME: flags: DIFlagPublic | DIFlagStaticMember, +// CHECK-SAME: extraData: i32 18) +// +// CHECK: !MDDerivedType(tag: DW_TAG_member, name: "x_a" +// CHECK-SAME: flags: DIFlagPublic | DIFlagStaticMember) + +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "static_decl_templ" +// CHECK-NOT: DIFlagFwdDecl +// CHECK-SAME: ){{$}} +// CHECK: !MDDerivedType(tag: DW_TAG_member, name: "static_decl_templ_var" + +// CHECK: [[NS_X:![0-9]+]] = !MDNamespace(name: "x" // Test this in an anonymous namespace to ensure the type is retained even when // it doesn't get automatically retained by the string type reference machinery. @@ -57,8 +94,8 @@ struct anon_static_decl_struct { } -// CHECK: ; [ DW_TAG_structure_type ] [anon_static_decl_struct] {{.*}} [def] -// CHECK: ; [ DW_TAG_member ] [anon_static_decl_var] +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "anon_static_decl_struct" +// CHECK: !MDDerivedType(tag: DW_TAG_member, name: "anon_static_decl_var" int ref() { return anon_static_decl_struct::anon_static_decl_var; @@ -76,11 +113,11 @@ int static_decl_templ_ref() { return static_decl_templ::static_decl_templ_var; } -// CHECK: !"0x34\00a\00{{.*}}", null, {{.*}} @_ZN1C1aE, ![[DECL_A]]} ; [ DW_TAG_variable ] [a] {{.*}} [def] -// CHECK: !"0x34\00b\00{{.*}}", null, {{.*}} @_ZN1C1bE, ![[DECL_B]]} ; [ DW_TAG_variable ] [b] {{.*}} [def] -// CHECK: !"0x34\00c\00{{.*}}", null, {{.*}} @_ZN1C1cE, ![[DECL_C]]} ; [ DW_TAG_variable ] [c] {{.*}} [def] +// CHECK: !MDGlobalVariable(name: "a", {{.*}}variable: i32* @_ZN1C1aE, declaration: ![[DECL_A]]) +// CHECK: !MDGlobalVariable(name: "b", {{.*}}variable: i32* @_ZN1C1bE, declaration: ![[DECL_B]]) +// CHECK: !MDGlobalVariable(name: "c", {{.*}}variable: i32* @_ZN1C1cE, declaration: ![[DECL_C]]) -// CHECK-NOT: ; [ DW_TAG_variable ] [anon_static_decl_var] +// CHECK-NOT: !MDGlobalVariable(name: "anon_static_decl_var" // Verify that even when a static member declaration is created lazily when // creating the definition, the declaration line is that of the canonical @@ -91,7 +128,9 @@ struct V { virtual ~V(); // cause the definition of 'V' to be omitted by no-standalone-debug optimization static const int const_va = 42; }; -// CHECK: i32 42} ; [ DW_TAG_member ] [const_va] [line [[@LINE-2]], +// CHECK: !MDDerivedType(tag: DW_TAG_member, name: "const_va", +// CHECK-SAME: line: [[@LINE-3]] +// CHECK-SAME: extraData: i32 42 const int V::const_va; namespace x { @@ -101,4 +140,5 @@ struct y { int y::z; } -// CHECK: !"0x34\00z\00{{.*}}", [[NS_X]], {{.*}} ; [ DW_TAG_variable ] [z] {{.*}} [def] +// CHECK: !MDGlobalVariable(name: "z", +// CHECK-SAME: scope: [[NS_X]] diff --git a/clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp b/clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp index b0ba299..8168fd8 100644 --- a/clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp +++ b/clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp @@ -4,20 +4,22 @@ // type info at all. // RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -g %s -o - -gline-tables-only | FileCheck %s -check-prefix LINES-ONLY -// LINES-ONLY-NOT: DW_TAG_structure_type +// LINES-ONLY-NOT: !MDCompositeType(tag: DW_TAG_structure_type template struct a { }; extern template class a; -// CHECK-NOT: ; [ DW_TAG_structure_type ] [a] +// CHECK-NOT: MDCompositeType(tag: DW_TAG_structure_type, name: "a" template struct b { }; extern template class b; b bi; -// CHECK: ; [ DW_TAG_structure_type ] [b] {{.*}} [def] +// CHECK: MDCompositeType(tag: DW_TAG_structure_type, name: "b" +// CHECK-NOT: DIFlagFwdDecl +// CHECK-SAME: ){{$}} template struct c { @@ -25,7 +27,8 @@ struct c { }; extern template class c; c ci; -// CHECK: ; [ DW_TAG_structure_type ] [c] {{.*}} [decl] +// CHECK: MDCompositeType(tag: DW_TAG_structure_type, name: "c" +// CHECK-SAME: DIFlagFwdDecl template struct d { @@ -33,7 +36,9 @@ struct d { }; extern template class d; d di; -// CHECK: ; [ DW_TAG_structure_type ] [d] {{.*}} [def] +// CHECK: MDCompositeType(tag: DW_TAG_structure_type, name: "d" +// CHECK-NOT: DIFlagFwdDecl +// CHECK-SAME: ){{$}} template struct e { @@ -47,7 +52,9 @@ e ei; // There's no guarantee that the out of line definition will appear before the // explicit template instantiation definition, so conservatively emit the type // definition here. -// CHECK: ; [ DW_TAG_structure_type ] [e] {{.*}} [def] +// CHECK: MDCompositeType(tag: DW_TAG_structure_type, name: "e" +// CHECK-NOT: DIFlagFwdDecl +// CHECK-SAME: ){{$}} template struct f { @@ -58,7 +65,9 @@ template void f::g() { } f fi; -// CHECK: ; [ DW_TAG_structure_type ] [f] {{.*}} [def] +// CHECK: MDCompositeType(tag: DW_TAG_structure_type, name: "f" +// CHECK-NOT: DIFlagFwdDecl +// CHECK-SAME: ){{$}} template struct g { @@ -68,13 +77,17 @@ template <> void g::f(); extern template class g; g gi; -// CHECK: ; [ DW_TAG_structure_type ] [g] {{.*}} [def] +// CHECK: MDCompositeType(tag: DW_TAG_structure_type, name: "g" +// CHECK-NOT: DIFlagFwdDecl +// CHECK-SAME: ){{$}} template struct h { }; template class h; -// CHECK: ; [ DW_TAG_structure_type ] [h] {{.*}} [def] +// CHECK: MDCompositeType(tag: DW_TAG_structure_type, name: "h" +// CHECK-NOT: DIFlagFwdDecl +// CHECK-SAME: ){{$}} template struct i { @@ -83,14 +96,16 @@ struct i { template<> void i::f(); extern template class i; i ii; -// CHECK: ; [ DW_TAG_structure_type ] [i] {{.*}} [def] +// CHECK: MDCompositeType(tag: DW_TAG_structure_type, name: "i" +// CHECK-NOT: DIFlagFwdDecl +// CHECK-SAME: ){{$}} template struct j { }; extern template class j; j jj; -// CHECK: ; [ DW_TAG_structure_type ] [j] +// CHECK: MDCompositeType(tag: DW_TAG_structure_type, name: "j" template struct k { @@ -98,12 +113,4 @@ struct k { template <> struct k; template struct k; -// CHECK-NOT: ; [ DW_TAG_structure_type ] [k] - -template -struct l { - int x; -}; -extern template class l; -l li; -// CHECK: [ DW_TAG_structure_type ] [l] {{.*}}size {{[^0]}} +// CHECK-NOT: !MDCompositeType(tag: DW_TAG_structure_type, name: "k" diff --git a/clang/test/CodeGenCXX/debug-info-template-fwd.cpp b/clang/test/CodeGenCXX/debug-info-template-fwd.cpp index b2b70730..cede285 100644 --- a/clang/test/CodeGenCXX/debug-info-template-fwd.cpp +++ b/clang/test/CodeGenCXX/debug-info-template-fwd.cpp @@ -2,7 +2,9 @@ // This test is for a crash when emitting debug info for not-yet-completed // types. // Test that we don't actually emit a forward decl for the offending class: -// CHECK: [ DW_TAG_structure_type ] [Derived] {{.*}} [def] +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "Derived" +// CHECK-NOT: DIFlagFwdDecl +// CHECK-SAME: ){{$}} // rdar://problem/15931354 template class Derived; diff --git a/clang/test/CodeGenCXX/debug-info-template-limit.cpp b/clang/test/CodeGenCXX/debug-info-template-limit.cpp index 8e05c7f..bb5e5ab 100644 --- a/clang/test/CodeGenCXX/debug-info-template-limit.cpp +++ b/clang/test/CodeGenCXX/debug-info-template-limit.cpp @@ -1,8 +1,8 @@ // RUN: %clang_cc1 -emit-llvm -fno-standalone-debug -triple %itanium_abi_triple -g %s -o - | FileCheck %s // Check that this pointer type is TC -// CHECK: ![[LINE:[0-9]+]] = !{!"0x2\00TC\00{{.*}}", {{.*}} !"_ZTS2TCIiE"} ; [ DW_TAG_class_type ] -// CHECK: !"_ZTS2TCIiE"} ; [ DW_TAG_pointer_type ]{{.*}}[from _ZTS2TCIiE] +// CHECK: ![[LINE:[0-9]+]] = !MDCompositeType(tag: DW_TAG_class_type, name: "TC"{{.*}}, identifier: "_ZTS2TCIiE") +// CHECK: !MDDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTS2TCIiE" template class TC { diff --git a/clang/test/CodeGenCXX/debug-info-template-member.cpp b/clang/test/CodeGenCXX/debug-info-template-member.cpp index c1d9f67..dca32a3 100644 --- a/clang/test/CodeGenCXX/debug-info-template-member.cpp +++ b/clang/test/CodeGenCXX/debug-info-template-member.cpp @@ -16,34 +16,49 @@ inline int add3(int x) { return MyClass().add<3>(x); // even though add<3> is ODR used, don't emit it since we don't codegen it } -// CHECK: [[FOO_MEM:![0-9]*]], null, null, !"_ZTS3foo"} ; [ DW_TAG_structure_type ] [foo] +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "foo" +// CHECK-SAME: elements: [[FOO_MEM:![0-9]*]] +// CHECK-SAME: identifier: "_ZTS3foo" // CHECK: [[FOO_MEM]] = !{[[FOO_FUNC:![0-9]*]]} -// CHECK: [[FOO_FUNC]] = !{!"0x2e\00func\00func\00_ZN3foo4funcEN5outerIS_E5innerE\00{{.*}}"{{, [^,]+, [^,]+}}, [[FOO_FUNC_TYPE:![0-9]*]], {{.*}} ; [ DW_TAG_subprogram ] {{.*}} [func] -// CHECK: [[FOO_FUNC_TYPE]] = {{.*}}, [[FOO_FUNC_PARAMS:![0-9]*]], null, null, null} ; [ DW_TAG_subroutine_type ] +// CHECK: [[FOO_FUNC]] = !MDSubprogram(name: "func", linkageName: "_ZN3foo4funcEN5outerIS_E5innerE", +// CHECK-SAME: type: [[FOO_FUNC_TYPE:![0-9]*]] +// CHECK: [[FOO_FUNC_TYPE]] = !MDSubroutineType(types: [[FOO_FUNC_PARAMS:![0-9]*]]) // CHECK: [[FOO_FUNC_PARAMS]] = !{null, !{{[0-9]*}}, !"[[OUTER_FOO_INNER_ID:.*]]"} -// CHECK: !{{[0-9]*}} = {{.*}}, null, !"[[OUTER_FOO_INNER_ID]]"} ; [ DW_TAG_structure_type ] [inner] +// CHECK: !{{[0-9]*}} = !MDCompositeType(tag: DW_TAG_structure_type, name: "inner"{{.*}}, identifier: "[[OUTER_FOO_INNER_ID]]") -// CHECK: [[VIRT_MEM:![0-9]*]], !"_ZTS4virtI4elemE", [[VIRT_TEMP_PARAM:![0-9]*]], !"_ZTS4virtI4elemE"} ; [ DW_TAG_structure_type ] [virt] {{.*}} [def] +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "virt" +// CHECK-SAME: elements: [[VIRT_MEM:![0-9]*]] +// CHECK-SAME: vtableHolder: !"_ZTS4virtI4elemE" +// CHECK-SAME: templateParams: [[VIRT_TEMP_PARAM:![0-9]*]] +// CHECK-SAME: identifier: "_ZTS4virtI4elemE" // CHECK: [[VIRT_TEMP_PARAM]] = !{[[VIRT_T:![0-9]*]]} -// CHECK: [[VIRT_T]] = !{!"0x2f\00T\000\000"{{, [^,]+}}, !"_ZTS4elem", {{.*}} ; [ DW_TAG_template_type_parameter ] +// CHECK: [[VIRT_T]] = !MDTemplateTypeParameter(name: "T", type: !"_ZTS4elem") -// CHECK: [[C:![0-9]*]] = {{.*}}, [[C_MEM:![0-9]*]], !"_ZTS7MyClass", null, !"_ZTS7MyClass"} ; [ DW_TAG_structure_type ] [MyClass] +// CHECK: [[C:![0-9]*]] = !MDCompositeType(tag: DW_TAG_structure_type, name: "MyClass" +// CHECK-SAME: elements: [[C_MEM:![0-9]*]] +// CHECK-SAME: vtableHolder: !"_ZTS7MyClass" +// CHECK-SAME: identifier: "_ZTS7MyClass") // CHECK: [[C_MEM]] = !{[[C_VPTR:![0-9]*]], [[C_FUNC:![0-9]*]]} -// CHECK: [[C_VPTR]] = {{.*}} ; [ DW_TAG_member ] [_vptr$MyClass] +// CHECK: [[C_VPTR]] = !MDDerivedType(tag: DW_TAG_member, name: "_vptr$MyClass" -// CHECK: [[C_FUNC]] = {{.*}} ; [ DW_TAG_subprogram ] [line 7] [func] +// CHECK: [[C_FUNC]] = !MDSubprogram(name: "func",{{.*}} line: 7, -// CHECK: [[ELEM:![0-9]*]] = {{.*}}, [[ELEM_MEM:![0-9]*]], null, null, !"_ZTS4elem"} ; [ DW_TAG_structure_type ] [elem] {{.*}} [def] +// CHECK: [[ELEM:![0-9]*]] = !MDCompositeType(tag: DW_TAG_structure_type, name: "elem" +// CHECK-SAME: elements: [[ELEM_MEM:![0-9]*]] +// CHECK-SAME: identifier: "_ZTS4elem" // CHECK: [[ELEM_MEM]] = !{[[ELEM_X:![0-9]*]]} -// CHECK: [[ELEM_X]] = {{.*}} ; [ DW_TAG_member ] [x] {{.*}} [static] [from _ZTS4virtI4elemE] +// CHECK: [[ELEM_X]] = !MDDerivedType(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: !"_ZTS7MyClass", {{.*}} ; [ DW_TAG_subprogram ] [line 0] [MyClass] -// CHECK: !"_ZTS7MyClass", {{.*}} ; [ DW_TAG_subprogram ] [line 4] [add<2>] +// CHECK: !MDSubprogram(name: "MyClass" +// CHECK-SAME: scope: !"_ZTS7MyClass" +// CHECK: !MDSubprogram(name: "add<2>" +// CHECK-SAME: scope: !"_ZTS7MyClass" template struct outer { @@ -65,7 +80,9 @@ inline void func() { outer::inner x; -// CHECK: !"0x34\00{{.*}}", {{.*}}, !"[[OUTER_FOO_INNER_ID]]", %"struct.outer::inner"* @x, {{.*}} ; [ DW_TAG_variable ] [x] +// CHECK: !MDGlobalVariable(name: "x", +// CHECK-SAME: type: !"[[OUTER_FOO_INNER_ID]]" +// CHECK-SAME: variable: %"struct.outer::inner"* @x template struct virt { diff --git a/clang/test/CodeGenCXX/debug-info-template-partial-specialization.cpp b/clang/test/CodeGenCXX/debug-info-template-partial-specialization.cpp index 6940c0f..d686b81 100644 --- a/clang/test/CodeGenCXX/debug-info-template-partial-specialization.cpp +++ b/clang/test/CodeGenCXX/debug-info-template-partial-specialization.cpp @@ -3,7 +3,9 @@ namespace __pointer_type_imp { template struct __pointer_type1 {}; - // CHECK: ![[PARAMS:[0-9]+]], !"_ZTSN18__pointer_type_imp15__pointer_type1I1C14default_deleteIS1_ELb0EEE"} ; [ DW_TAG_structure_type ] [__pointer_type1, false>] [line [[@LINE+1]], size 8, align 8, offset 0] [def] [from ] + // CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "__pointer_type1, false>", + // CHECK-SAME: templateParams: ![[PARAMS:[0-9]+]] + // CHECK-SAME: identifier: "_ZTSN18__pointer_type_imp15__pointer_type1I1C14default_deleteIS1_ELb0EEE" template struct __pointer_type1<_Tp, _Dp, false> { typedef _Tp* type; @@ -15,7 +17,7 @@ struct __pointer_type2 // Test that the bool template type parameter is emitted. // // CHECK: ![[PARAMS]] = !{!{{.*}}, !{{.*}}, ![[FALSE:[0-9]+]]} - // CHECK: ![[FALSE]] = {{.*}} i8 0, {{.*}}} ; [ DW_TAG_template_value_parameter ] + // CHECK: ![[FALSE]] = !MDTemplateValueParameter(type: !{{[0-9]+}}, value: i8 0) typedef typename __pointer_type_imp::__pointer_type1<_Tp, _Dp, false>::type type; }; template struct default_delete {}; diff --git a/clang/test/CodeGenCXX/debug-info-template-quals.cpp b/clang/test/CodeGenCXX/debug-info-template-quals.cpp index 15c096f..beb03e8 100644 --- a/clang/test/CodeGenCXX/debug-info-template-quals.cpp +++ b/clang/test/CodeGenCXX/debug-info-template-quals.cpp @@ -15,13 +15,17 @@ void foo (const char *c) { str.assign(c, str); } -// CHECK: [[BS:.*]] = {{.*}} ; [ DW_TAG_structure_type ] [basic_string] [line 4, size 8, align 8, offset 0] [def] [from ] -// CHECK: [[TYPE:![0-9]*]] = !{!"0x15\00{{.*}}"{{.*}}, [[ARGS:.*]], null, null, null} ; [ DW_TAG_subroutine_type ] +// CHECK: [[BS:.*]] = !MDCompositeType(tag: DW_TAG_structure_type, name: "basic_string" +// CHECK-SAME: line: 4 +// CHECK-SAME: size: 8, align: 8 +// CHECK: [[TYPE:![0-9]*]] = !MDSubroutineType(types: [[ARGS:.*]]) // CHECK: [[ARGS]] = !{!{{.*}}, !{{.*}}, [[P:![0-9]*]], [[R:.*]]} -// CHECK: [[P]] = {{.*}}, [[CON:![0-9]*]]} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from ] -// CHECK: [[CON]] = {{.*}}, [[CH:![0-9]*]]} ; [ DW_TAG_const_type ] [line 0, size 0, align 0, offset 0] [from char] -// CHECK: [[CH]] = {{.*}} ; [ DW_TAG_base_type ] [char] [line 0, size 8, align 8, offset 0, enc DW_ATE_signed_char] +// CHECK: [[P]] = !MDDerivedType(tag: DW_TAG_pointer_type, baseType: [[CON:![0-9]*]] +// CHECK: [[CON]] = !MDDerivedType(tag: DW_TAG_const_type, baseType: [[CH:![0-9]*]] +// CHECK: [[CH]] = !MDBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) -// CHECK: [[R]] = {{.*}}, [[CON2:![0-9]*]]} ; [ DW_TAG_reference_type ] [line 0, size 0, align 0, offset 0] [from ] -// CHECK: [[CON2]] = {{.*}}, !"_ZTS12basic_stringIcE"} ; [ DW_TAG_const_type ] [line 0, size 0, align 0, offset 0] [from _ZTS12basic_stringIcE] -// CHECK: !"0x2e\00assign\00{{.*}}\008"{{, [^,]+, [^,]+}}, !8, {{.*}} ; [ DW_TAG_subprogram ] [line 7] [def] [scope 8] [assign] +// CHECK: [[R]] = !MDDerivedType(tag: DW_TAG_reference_type, baseType: [[CON2:![0-9]*]] +// CHECK: [[CON2]] = !MDDerivedType(tag: DW_TAG_const_type, baseType: !"_ZTS12basic_stringIcE" +// CHECK: !MDSubprogram(name: "assign" +// CHECK-SAME: line: 7 +// CHECK-SAME: scopeLine: 8 diff --git a/clang/test/CodeGenCXX/debug-info-template.cpp b/clang/test/CodeGenCXX/debug-info-template.cpp index 17b9450..306e070 100644 --- a/clang/test/CodeGenCXX/debug-info-template.cpp +++ b/clang/test/CodeGenCXX/debug-info-template.cpp @@ -1,96 +1,112 @@ // RUN: %clang -S -emit-llvm -target x86_64-unknown_unknown -g %s -o - -std=c++11 | FileCheck %s -// CHECK: !"0x11\00{{.*}}"{{, [^,]+, [^,]+}}, [[RETAIN:![0-9]*]], {{.*}} ; [ DW_TAG_compile_unit ] +// CHECK: !MDCompileUnit( +// CHECK-SAME: retainedTypes: [[RETAIN:![0-9]*]] // CHECK: [[EMPTY:![0-9]*]] = !{} // CHECK: [[RETAIN]] = !{!{{[0-9]]*}}, [[FOO:![0-9]*]], -// CHECK: [[TC:![0-9]*]] = {{.*}}, [[TCARGS:![0-9]*]], !"{{.*}}"} ; [ DW_TAG_structure_type ] [TC] +// CHECK: [[TC:![0-9]*]] = !MDCompositeType(tag: DW_TAG_structure_type, name: "TC" +// CHECK-SAME: templateParams: [[TCARGS:![0-9]*]] // CHECK: [[TCARGS]] = !{[[TCARG1:![0-9]*]], [[TCARG2:![0-9]*]], [[TCARG3:![0-9]*]], [[TCARG4:![0-9]*]], [[TCARG5:![0-9]*]], [[TCARG6:![0-9]*]], [[TCARG7:![0-9]*]]} // -// We seem to be missing file/line/col info on template value parameters - -// metadata supports it but it's not populated. GCC doesn't emit it either, -// perhaps we should just drop it from the metadata. -// -// CHECK: [[TCARG1]] = !{!"0x2f\00T\000\000", null, [[UINT:![0-9]*]], null} ; [ DW_TAG_template_type_parameter ] -// CHECK: [[UINT:![0-9]*]] = {{.*}} ; [ DW_TAG_base_type ] [unsigned int] -// CHECK: [[TCARG2]] = !{!"0x30\00\00{{.*}}", {{[^,]+}}, [[UINT]], i32 2, {{.*}} ; [ DW_TAG_template_value_parameter ] -// CHECK: [[TCARG3]] = !{!"0x30\00x\00{{.*}}", {{[^,]+}}, [[CINTPTR:![0-9]*]], i32* @glb, {{.*}} ; [ DW_TAG_template_value_parameter ] -// CHECK: [[CINTPTR]] = {{.*}}, [[CINT:![0-9]*]]} ; [ DW_TAG_pointer_type ] {{.*}} [from ] -// CHECK: [[CINT]] = {{.*}}, [[INT:![0-9]*]]} ; [ DW_TAG_const_type ] {{.*}} [from int] -// CHECK: [[INT]] = {{.*}} ; [ DW_TAG_base_type ] [int] -// CHECK: [[TCARG4]] = !{!"0x30\00a\00{{.*}}", {{[^,]+}}, [[MEMINTPTR:![0-9]*]], i64 8, {{.*}} ; [ DW_TAG_template_value_parameter ] -// CHECK: [[MEMINTPTR]] = {{.*}}, !"_ZTS3foo"} ; [ DW_TAG_ptr_to_member_type ] {{.*}}[from int] +// CHECK: [[TCARG1]] = !MDTemplateTypeParameter(name: "T", type: [[UINT:![0-9]*]]) +// CHECK: [[UINT:![0-9]*]] = !MDBasicType(name: "unsigned int" +// CHECK: [[TCARG2]] = !MDTemplateValueParameter(type: [[UINT]], value: i32 2) +// CHECK: [[TCARG3]] = !MDTemplateValueParameter(name: "x", type: [[CINTPTR:![0-9]*]], value: i32* @glb) +// CHECK: [[CINTPTR]] = !MDDerivedType(tag: DW_TAG_pointer_type, {{.*}}baseType: [[CINT:![0-9]+]] +// CHECK: [[CINT]] = !MDDerivedType(tag: DW_TAG_const_type, {{.*}}baseType: [[INT:![0-9]+]] +// CHECK: [[INT]] = !MDBasicType(name: "int" +// CHECK: [[TCARG4]] = !MDTemplateValueParameter(name: "a", type: [[MEMINTPTR:![0-9]*]], value: i64 8) +// CHECK: [[MEMINTPTR]] = !MDDerivedType(tag: DW_TAG_ptr_to_member_type, {{.*}}baseType: [[INT]], {{.*}}extraData: !"_ZTS3foo") // // Currently Clang emits the pointer-to-member-function value, but LLVM doesn't // use it (GCC doesn't emit a value for pointers to member functions either - so // it's not clear what, if any, format would be acceptable to GDB) // -// CHECK: [[TCARG5]] = !{!"0x30\00b\00{{.*}}", {{[^,]+}}, [[MEMFUNPTR:![0-9]*]], { i64, i64 } { i64 ptrtoint (void (%struct.foo*)* @_ZN3foo1fEv to i64), i64 0 }, {{.*}} ; [ DW_TAG_template_value_parameter ] -// CHECK: [[MEMFUNPTR]] = {{.*}}, [[FTYPE:![0-9]*]], !"_ZTS3foo"} ; [ DW_TAG_ptr_to_member_type ] -// CHECK: [[FTYPE]] = {{.*}}, [[FARGS:![0-9]*]], null, null, null} ; [ DW_TAG_subroutine_type ] +// CHECK: [[TCARG5]] = !MDTemplateValueParameter(name: "b", type: [[MEMFUNPTR:![0-9]*]], value: { i64, i64 } { i64 ptrtoint (void (%struct.foo*)* @_ZN3foo1fEv to i64), i64 0 }) +// CHECK: [[MEMFUNPTR]] = !MDDerivedType(tag: DW_TAG_ptr_to_member_type, {{.*}}baseType: [[FTYPE:![0-9]*]], {{.*}}extraData: !"_ZTS3foo") +// CHECK: [[FTYPE]] = !MDSubroutineType(types: [[FARGS:![0-9]*]]) // CHECK: [[FARGS]] = !{null, [[FARG1:![0-9]*]]} -// CHECK: [[FARG1]] = {{.*}} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [artificial] [from _ZTS3foo] +// CHECK: [[FARG1]] = !MDDerivedType(tag: DW_TAG_pointer_type, +// CHECK-SAME: baseType: !"_ZTS3foo" +// CHECK-NOT: line: +// CHECK-SAME: size: 64, align: 64 +// CHECK-NOT: offset: 0 +// CHECK-SAME: DIFlagArtificial // -// CHECK: [[TCARG6]] = !{!"0x30\00f\00{{.*}}", {{[^,]+}}, [[FUNPTR:![0-9]*]], void ()* @_ZN3foo1gEv, {{.*}} ; [ DW_TAG_template_value_parameter ] -// CHECK: [[FUNPTR]] = {{.*}}, [[FUNTYPE:![0-9]*]]} ; [ DW_TAG_pointer_type ] -// CHECK: [[FUNTYPE]] = {{.*}}, [[FUNARGS:![0-9]*]], null, null, null} ; [ DW_TAG_subroutine_type ] +// CHECK: [[TCARG6]] = !MDTemplateValueParameter(name: "f", type: [[FUNPTR:![0-9]*]], value: void ()* @_ZN3foo1gEv) +// CHECK: [[FUNPTR]] = !MDDerivedType(tag: DW_TAG_pointer_type, baseType: [[FUNTYPE:![0-9]*]] +// CHECK: [[FUNTYPE]] = !MDSubroutineType(types: [[FUNARGS:![0-9]*]]) // CHECK: [[FUNARGS]] = !{null} -// CHECK: [[TCARG7]] = !{!"0x4107\00Is\000\000", null, null, [[TCARG7_VALS:![0-9]*]], null} ; [ DW_TAG_GNU_template_parameter_pack ] +// CHECK: [[TCARG7]] = !MDTemplateValueParameter(tag: DW_TAG_GNU_template_parameter_pack, name: "Is", value: [[TCARG7_VALS:![0-9]*]]) // CHECK: [[TCARG7_VALS]] = !{[[TCARG7_1:![0-9]*]], [[TCARG7_2:![0-9]*]], [[TCARG7_3:![0-9]*]]} -// CHECK: [[TCARG7_1]] = !{!"0x30\00\00{{.*}}", {{[^,]+}}, [[INT]], i32 1, {{.*}} ; [ DW_TAG_template_value_parameter ] -// CHECK: [[TCARG7_2]] = !{!"0x30\00\00{{.*}}", {{[^,]+}}, [[INT]], i32 2, {{.*}} ; [ DW_TAG_template_value_parameter ] -// CHECK: [[TCARG7_3]] = !{!"0x30\00\00{{.*}}", {{[^,]+}}, [[INT]], i32 3, {{.*}} ; [ DW_TAG_template_value_parameter ] +// CHECK: [[TCARG7_1]] = !MDTemplateValueParameter(type: [[INT]], value: i32 1) +// CHECK: [[TCARG7_2]] = !MDTemplateValueParameter(type: [[INT]], value: i32 2) +// CHECK: [[TCARG7_3]] = !MDTemplateValueParameter(type: [[INT]], value: i32 3) // // We could just emit a declaration of 'foo' here, rather than the entire // definition (same goes for any time we emit a member (function or data) // pointer type) -// CHECK: [[FOO]] = {{.*}}, !"_ZTS3foo"} ; [ DW_TAG_structure_type ] [foo] -// CHECK: !"0x2e\00f\00f\00_ZN3foo1fEv\00{{.*}}", [[FTYPE:![0-9]*]], {{.*}} ; [ DW_TAG_subprogram ] +// CHECK: [[FOO]] = !MDCompositeType(tag: DW_TAG_structure_type, name: "foo", {{.*}}identifier: "_ZTS3foo") +// CHECK: !MDSubprogram(name: "f", linkageName: "_ZN3foo1fEv", {{.*}}type: [[FTYPE:![0-9]*]] // -// CHECK: !"0x13\00{{.*}}", !{{[0-9]*}}, !"_ZTS2TCIjLj2EXadL_Z3glbEEXadL_ZN3foo1eEEEXadL_ZNS0_1fEvEEXadL_ZNS0_1gEvEEJLi1ELi2ELi3EEE", {{.*}}, !"[[TCNESTED:.*]]"} ; [ DW_TAG_structure_type ] [nested] -// CHECK: [[TCNARGS:![0-9]*]], !"[[TCNT:.*]]"} ; [ DW_TAG_structure_type ] [TC] +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "nested", +// CHECK-SAME: scope: !"_ZTS2TCIjLj2EXadL_Z3glbEEXadL_ZN3foo1eEEEXadL_ZNS0_1fEvEEXadL_ZNS0_1gEvEEJLi1ELi2ELi3EEE" +// CHECK-SAME: identifier: "[[TCNESTED:.*]]") +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "TC" +// CHECK-SAME: templateParams: [[TCNARGS:![0-9]*]] +// CHECK-SAME: identifier: "[[TCNT:.*]]") // CHECK: [[TCNARGS]] = !{[[TCNARG1:![0-9]*]], [[TCNARG2:![0-9]*]], [[TCNARG3:![0-9]*]], [[TCNARG4:![0-9]*]], [[TCNARG5:![0-9]*]], [[TCNARG6:![0-9]*]], [[TCNARG7:![0-9]*]]} -// CHECK: [[TCNARG1]] = !{!"0x2f\00T\000\000", null, [[INT]], null} ; [ DW_TAG_template_type_parameter ] -// CHECK: [[TCNARG2]] = !{!"0x30\00\000\000", null, [[INT]], i32 -3, null} ; [ DW_TAG_template_value_parameter ] -// CHECK: [[TCNARG3]] = !{!"0x30\00x\000\000", null, [[CINTPTR]], i8 0, null} ; [ DW_TAG_template_value_parameter ] +// CHECK: [[TCNARG1]] = !MDTemplateTypeParameter(name: "T", type: [[INT]]) +// CHECK: [[TCNARG2]] = !MDTemplateValueParameter(type: [[INT]], value: i32 -3) +// CHECK: [[TCNARG3]] = !MDTemplateValueParameter(name: "x", type: [[CINTPTR]], value: i8 0) // The interesting null pointer: -1 for member data pointers (since they are // just an offset in an object, they can be zero and non-null for the first // member) -// CHECK: [[TCNARG4]] = !{!"0x30\00a\000\000", null, [[MEMINTPTR]], i64 -1, null} ; [ DW_TAG_template_value_parameter ] +// CHECK: [[TCNARG4]] = !MDTemplateValueParameter(name: "a", type: [[MEMINTPTR]], value: i64 -1) // // In some future iteration we could possibly emit the value of a null member // function pointer as '{ i64, i64 } zeroinitializer' as it may be handled // naturally from the LLVM CodeGen side once we decide how to handle non-null // member function pointers. For now, it's simpler just to emit the 'i8 0'. // -// CHECK: [[TCNARG5]] = !{!"0x30\00b\000\000", null, [[MEMFUNPTR]], i8 0, null} ; [ DW_TAG_template_value_parameter ] -// CHECK: [[TCNARG6]] = !{!"0x30\00f\000\000", null, [[FUNPTR]], i8 0, null} ; [ DW_TAG_template_value_parameter ] -// CHECK: [[TCNARG7]] = !{!"0x4107\00Is\000\000", null, null, [[EMPTY]], null} ; [ DW_TAG_GNU_template_parameter_pack ] +// CHECK: [[TCNARG5]] = !MDTemplateValueParameter(name: "b", type: [[MEMFUNPTR]], value: i8 0) +// CHECK: [[TCNARG6]] = !MDTemplateValueParameter(name: "f", type: [[FUNPTR]], value: i8 0) +// CHECK: [[TCNARG7]] = !MDTemplateValueParameter(tag: DW_TAG_GNU_template_parameter_pack, name: "Is", value: [[EMPTY]]) // FIXME: these parameters should probably be rendered as 'glb' rather than // '&glb', since they're references, not pointers. -// CHECK: [[NNARGS:![0-9]*]], !"[[NNT:.*]]"} ; [ DW_TAG_structure_type ] [NN] +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "NN", +// CHECK-SAME: templateParams: [[NNARGS:![0-9]*]] +// CHECK-SAME: identifier: "[[NNT:.*]]") // CHECK: [[NNARGS]] = !{[[NNARG1:![0-9]*]], [[NNARG2:![0-9]*]], [[NNARG3:![0-9]*]]} -// CHECK: [[NNARG1]] = !{!"0x4106\00tmpl\000\000", null, null, !"tmpl_impl", null} ; [ DW_TAG_GNU_template_template_param ] -// CHECK: [[NNARG2]] = !{!"0x30\00lvr\00{{.*}}", {{[^,]+}}, [[INTLVR:![0-9]*]], i32* @glb, {{.*}} ; [ DW_TAG_template_value_parameter ] -// CHECK: [[INTLVR]] = {{.*}}, [[INT]]} ; [ DW_TAG_reference_type ] {{.*}} [from int] -// CHECK: [[NNARG3]] = !{!"0x30\00rvr\00{{.*}}", {{[^,]+}}, [[INTRVR:![0-9]*]], i32* @glb, {{.*}} ; [ DW_TAG_template_value_parameter ] -// CHECK: [[INTRVR]] = {{.*}}, [[INT]]} ; [ DW_TAG_rvalue_reference_type ] {{.*}} [from int] - -// CHECK: [[PTOARGS:![0-9]*]], !"{{.*}}"} ; [ DW_TAG_structure_type ] [PaddingAtEndTemplate<&PaddedObj>] +// CHECK: [[NNARG1]] = !MDTemplateValueParameter(tag: DW_TAG_GNU_template_template_param, name: "tmpl", value: !"tmpl_impl") +// CHECK: [[NNARG2]] = !MDTemplateValueParameter(name: "lvr", type: [[INTLVR:![0-9]*]], value: i32* @glb) +// CHECK: [[INTLVR]] = !MDDerivedType(tag: DW_TAG_reference_type, baseType: [[INT]] +// CHECK: [[NNARG3]] = !MDTemplateValueParameter(name: "rvr", type: [[INTRVR:![0-9]*]], value: i32* @glb) +// CHECK: [[INTRVR]] = !MDDerivedType(tag: DW_TAG_rvalue_reference_type, baseType: [[INT]] + +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "PaddingAtEndTemplate<&PaddedObj>" +// CHECK-SAME: templateParams: [[PTOARGS:![0-9]*]] // CHECK: [[PTOARGS]] = !{[[PTOARG1:![0-9]*]]} -// CHECK: [[PTOARG1]] = !{!"0x30\00\000\000", null, [[CONST_PADDINGATEND_PTR:![0-9]*]], %struct.PaddingAtEnd* @PaddedObj, null} ; [ DW_TAG_template_value_parameter ] -// CHECK: [[CONST_PADDINGATEND_PTR]] = {{.*}} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from _ZTS12PaddingAtEnd] +// CHECK: [[PTOARG1]] = !MDTemplateValueParameter(type: [[CONST_PADDINGATEND_PTR:![0-9]*]], value: %struct.PaddingAtEnd* @PaddedObj) +// CHECK: [[CONST_PADDINGATEND_PTR]] = !MDDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTS12PaddingAtEnd", size: 64, align: 64) -// CHECK: !"[[TCNESTED]]", %"struct.TC::nested"* @tci, null} ; [ DW_TAG_variable ] [tci] +// CHECK: !MDGlobalVariable(name: "tci", +// CHECK-SAME: type: !"[[TCNESTED]]" +// CHECK-SAME: variable: %"struct.TC::nested"* @tci -// CHECK: !"[[TCNT]]", %struct.TC* @tcn, null} ; [ DW_TAG_variable ] [tcn] +// CHECK: !MDGlobalVariable(name: "tcn" +// CHECK-SAME: type: !"[[TCNT]]" +// CHECK-SAME: variable: %struct.TC* @tcn -// CHECK: !"[[NNT]]", %struct.NN* @nn, null} ; [ DW_TAG_variable ] [nn] +// CHECK: !MDGlobalVariable(name: "nn" +// CHECK-SAME: type: !"[[NNT]]" +// CHECK-SAME: variable: %struct.NN* @nn struct foo { char pad[8]; // make the member pointer to 'e' a bit more interesting (nonzero) int e; diff --git a/clang/test/CodeGenCXX/debug-info-thunk.cpp b/clang/test/CodeGenCXX/debug-info-thunk.cpp index 9f18790..b15f0ba 100644 --- a/clang/test/CodeGenCXX/debug-info-thunk.cpp +++ b/clang/test/CodeGenCXX/debug-info-thunk.cpp @@ -14,4 +14,7 @@ struct C : A, B { void C::f() { } -// CHECK: !"0x2e\00\00\00_ZThn{{[48]}}_N1C1fEv\0015\00{{.*}}", {{.*}} ; [ DW_TAG_subprogram ] [line 15] [def]{{$}} +// CHECK: !MDSubprogram(linkageName: "_ZThn{{[48]}}_N1C1fEv" +// CHECK-SAME: line: 15 +// CHECK-SAME: isDefinition: true +// CHECK-SAME: ){{$}} diff --git a/clang/test/CodeGenCXX/debug-info-union-template.cpp b/clang/test/CodeGenCXX/debug-info-union-template.cpp index aa66e3f..009ab04 100644 --- a/clang/test/CodeGenCXX/debug-info-union-template.cpp +++ b/clang/test/CodeGenCXX/debug-info-union-template.cpp @@ -10,6 +10,8 @@ namespace PR15637 { Value f; } -// CHECK: !"0x17\00Value\00{{.*}}", {{.*}}, [[TTPARAM:![0-9]+]], !"_ZTSN7PR156375ValueIfEE"} ; [ DW_TAG_union_type ] [Value] +// CHECK: !MDCompositeType(tag: DW_TAG_union_type, name: "Value", +// CHECK-SAME: templateParams: [[TTPARAM:![0-9]+]] +// CHECK-SAME: identifier: "_ZTSN7PR156375ValueIfEE" // CHECK: [[TTPARAM]] = !{[[PARAMS:.*]]} -// CHECK: [[PARAMS]] = !{!"0x2f\00T\000\000", {{.*}} ; [ DW_TAG_template_type_parameter ] +// CHECK: [[PARAMS]] = !MDTemplateTypeParameter(name: "T" diff --git a/clang/test/CodeGenCXX/debug-info-union.cpp b/clang/test/CodeGenCXX/debug-info-union.cpp index 0aa48dc..cc1dbdc 100644 --- a/clang/test/CodeGenCXX/debug-info-union.cpp +++ b/clang/test/CodeGenCXX/debug-info-union.cpp @@ -10,7 +10,11 @@ union E { E e; -// CHECK: {{.*}} ; [ DW_TAG_union_type ] [E] [line 3, size 32, align 32, offset 0] -// CHECK: {{.*}} ; [ DW_TAG_subprogram ] [line 6] [bb] -// CHECK: {{.*}} ; [ DW_TAG_subprogram ] [line 7] [aa] -// CHECK: {{.*}} ; [ DW_TAG_subprogram ] [line 8] [E] +// CHECK: !MDCompositeType(tag: DW_TAG_union_type, name: "E" +// CHECK-SAME: line: 3 +// CHECK-SAME: size: 32, align: 32 +// CHECK-NOT: offset: +// CHECK-SAME: {{$}} +// CHECK: !MDSubprogram(name: "bb"{{.*}}, line: 6 +// CHECK: !MDSubprogram(name: "aa"{{.*}}, line: 7 +// CHECK: !MDSubprogram(name: "E"{{.*}}, line: 8 diff --git a/clang/test/CodeGenCXX/debug-info-uuid.cpp b/clang/test/CodeGenCXX/debug-info-uuid.cpp index b7e532b..b6e72ae 100644 --- a/clang/test/CodeGenCXX/debug-info-uuid.cpp +++ b/clang/test/CodeGenCXX/debug-info-uuid.cpp @@ -1,20 +1,33 @@ // RUN: %clang_cc1 -emit-llvm -fms-extensions -triple=x86_64-pc-win32 -g %s -o - -std=c++11 | FileCheck %s // RUN: %clang_cc1 -emit-llvm -fms-extensions -triple=x86_64-unknown-unknown -g %s -o - -std=c++11 2>&1 | FileCheck %s --check-prefix=CHECK-ITANIUM -// CHECK: [[TGIARGS:![0-9]*]], null} ; [ DW_TAG_structure_type ] [tmpl_guid<&__uuidof(uuid)>] +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "tmpl_guid<&__uuidof(uuid)>" +// CHECK-SAME: templateParams: [[TGIARGS:![0-9]*]] // CHECK: [[TGIARGS]] = !{[[TGIARG1:![0-9]*]]} -// CHECK: [[TGIARG1]] = !{!"0x30\00\00{{.*}}", {{[^,]+}}, [[CONST_GUID_PTR:![0-9]*]], { i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ab, {{.*}} ; [ DW_TAG_template_value_parameter ] -// CHECK: [[CONST_GUID_PTR]] = {{.*}}, [[CONST_GUID:![0-9]*]]} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from ] -// CHECK: [[CONST_GUID]] = {{.*}}, [[GUID:![0-9]*]]} ; [ DW_TAG_const_type ] [line 0, size 0, align 0, offset 0] [from _GUID] -// CHECK: [[GUID]] = {{.*}} ; [ DW_TAG_structure_type ] [_GUID] +// CHECK: [[TGIARG1]] = !MDTemplateValueParameter( +// CHECK-SAME: type: [[CONST_GUID_PTR:![0-9]*]] +// CHECK-SAME: value: { i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ab +// CHECK: [[CONST_GUID_PTR]] = !MDDerivedType(tag: DW_TAG_pointer_type +// CHECK-SAME: baseType: [[CONST_GUID:![0-9]*]] +// CHECK-SAME: size: 64 +// CHECK-SAME: align: 64 +// CHECK: [[CONST_GUID]] = !MDDerivedType(tag: DW_TAG_const_type +// CHECK-SAME: baseType: [[GUID:![0-9]*]] +// CHECK: [[GUID]] = !MDCompositeType(tag: DW_TAG_structure_type, name: "_GUID" -// CHECK: [[TGI2ARGS:![0-9]*]], null} ; [ DW_TAG_structure_type ] [tmpl_guid2<__uuidof(uuid)>] +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "tmpl_guid2<__uuidof(uuid)>" +// CHECK-SAME: templateParams: [[TGI2ARGS:![0-9]*]] // CHECK: [[TGI2ARGS]] = !{[[TGI2ARG1:![0-9]*]]} -// CHECK: [[TGI2ARG1]] = !{!"0x30\00\00{{.*}}", {{[^,]+}}, [[CONST_GUID_REF:![0-9]*]], { i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ab, {{.*}} ; [ DW_TAG_template_value_parameter ] -// CHECK: [[CONST_GUID_REF]] = {{.*}}, [[CONST_GUID:![0-9]*]]} ; [ DW_TAG_reference_type ] [line 0, size 0, align 0, offset 0] [from ] +// CHECK: [[TGI2ARG1]] = !MDTemplateValueParameter( +// CHECK-SAME: type: [[CONST_GUID_REF:![0-9]*]] +// CHECK-SAME: value: { i32, i16, i16, [8 x i8] }* @_GUID_12345678_1234_1234_1234_1234567890ab +// CHECK: [[CONST_GUID_REF]] = !MDDerivedType(tag: DW_TAG_reference_type, +// CHECK-SAME: baseType: [[CONST_GUID:![0-9]*]] -// CHECK-ITANIUM: !"_ZTS9tmpl_guidIXadu8__uuidoft4uuidEE"} ; [ DW_TAG_structure_type ] [tmpl_guid<&__uuidof(uuid)>] -// CHECK-ITANIUM: !"_ZTS10tmpl_guid2IXu8__uuidoft4uuidEE"} ; [ DW_TAG_structure_type ] [tmpl_guid2<__uuidof(uuid)>] +// CHECK-ITANIUM: !MDCompositeType(tag: DW_TAG_structure_type, name: "tmpl_guid<&__uuidof(uuid)>" +// CHECK-ITANIUM-SAME: identifier: "_ZTS9tmpl_guidIXadu8__uuidoft4uuidEE" +// CHECK-ITANIUM: !MDCompositeType(tag: DW_TAG_structure_type, name: "tmpl_guid2<__uuidof(uuid)>" +// CHECK-ITANIUM-SAME: identifier: "_ZTS10tmpl_guid2IXu8__uuidoft4uuidEE" struct _GUID; template diff --git a/clang/test/CodeGenCXX/debug-info-varargs.cpp b/clang/test/CodeGenCXX/debug-info-varargs.cpp index 25e8f35..e51681e 100644 --- a/clang/test/CodeGenCXX/debug-info-varargs.cpp +++ b/clang/test/CodeGenCXX/debug-info-varargs.cpp @@ -2,21 +2,27 @@ struct A { - // CHECK-DAG: !"0x2e\00a\00a\00_ZN1A1aEiz\00[[@LINE+1]]\00{{[^,]*}}"{{, [^,]+, [^,]+}}, ![[ATY:[0-9]+]]{{.*}}[ DW_TAG_subprogram ]{{.*}}[a] + // CHECK: !MDSubprogram(name: "a", linkageName: "_ZN1A1aEiz" + // CHECK-SAME: line: [[@LINE+2]] + // CHECK-SAME: type: ![[ATY:[0-9]+]] void a(int c, ...) {} - // CHECK: ![[ATY]] ={{.*}} ![[AARGS:[0-9]+]], null, null, null} ; [ DW_TAG_subroutine_type ] + // CHECK: ![[ATY]] = !MDSubroutineType(types: ![[AARGS:[0-9]+]]) // We no longer use an explicit unspecified parameter. Instead we use a trailing null to mean the function is variadic. // CHECK: ![[AARGS]] = !{null, !{{[0-9]+}}, !{{[0-9]+}}, null} }; - // CHECK: !"0x2e\00b\00b\00_Z1biz\00[[@LINE+1]]\00{{[^,]*}}"{{, [^,]+, [^,]+}}, ![[BTY:[0-9]+]]{{.*}}[ DW_TAG_subprogram ]{{.*}}[b] + // CHECK: !MDSubprogram(name: "b", linkageName: "_Z1biz" + // CHECK-SAME: line: [[@LINE+2]] + // CHECK-SAME: type: ![[BTY:[0-9]+]] void b(int c, ...) { - // CHECK: ![[BTY]] ={{.*}} ![[BARGS:[0-9]+]], null, null, null} ; [ DW_TAG_subroutine_type ] + // CHECK: ![[BTY]] = !MDSubroutineType(types: ![[BARGS:[0-9]+]]) // CHECK: ![[BARGS]] = !{null, !{{[0-9]+}}, null} A a; - // CHECK: !"0x100\00fptr\00[[@LINE+1]]\000"{{, [^,]+, [^,]+}}, ![[PST:[0-9]+]]} ; [ DW_TAG_auto_variable ] [fptr] [line [[@LINE+1]]] + // CHECK: !MDLocalVariable(tag: DW_TAG_auto_variable, name: "fptr" + // CHECK-SAME: line: [[@LINE+2]] + // CHECK-SAME: type: ![[PST:[0-9]+]] void (*fptr)(int, ...) = b; - // CHECK: ![[PST]] ={{.*}} ![[BTY]]} ; [ DW_TAG_pointer_type ] + // CHECK: ![[PST]] = !MDDerivedType(tag: DW_TAG_pointer_type, baseType: ![[BTY]], } diff --git a/clang/test/CodeGenCXX/debug-info-vtable-optzn.cpp b/clang/test/CodeGenCXX/debug-info-vtable-optzn.cpp index c693f79..cf2e60e 100644 --- a/clang/test/CodeGenCXX/debug-info-vtable-optzn.cpp +++ b/clang/test/CodeGenCXX/debug-info-vtable-optzn.cpp @@ -5,7 +5,7 @@ // module that has its vtable" optimization is disabled by default on // Darwin and FreeBSD. // -// CHECK: [ DW_TAG_member ] [lost] +// CHECK: !MDDerivedType(tag: DW_TAG_member, name: "lost" class A { virtual bool f() = 0; diff --git a/clang/test/CodeGenCXX/debug-info-wchar.cpp b/clang/test/CodeGenCXX/debug-info-wchar.cpp index 5b5fdcc..da7ce7f 100644 --- a/clang/test/CodeGenCXX/debug-info-wchar.cpp +++ b/clang/test/CodeGenCXX/debug-info-wchar.cpp @@ -1,5 +1,5 @@ // RUN: %clang_cc1 -emit-llvm -g %s -o -| FileCheck %s void foo() { -// CHECK: !"0x24\00wchar_t\00{{.*}}", null, null} ; [ DW_TAG_base_type ] [wchar_t] +// CHECK: !MDBasicType(name: "wchar_t" const wchar_t w = L'x'; } diff --git a/clang/test/CodeGenCXX/debug-info-windows-dtor.cpp b/clang/test/CodeGenCXX/debug-info-windows-dtor.cpp index a94f2b0..8233be7 100644 --- a/clang/test/CodeGenCXX/debug-info-windows-dtor.cpp +++ b/clang/test/CodeGenCXX/debug-info-windows-dtor.cpp @@ -18,5 +18,5 @@ template struct AB; // CHECK: call {{.*}}@"\01??_G?$AB@H@@UAEPAXI@Z"({{.*}}) #{{[0-9]*}}, !dbg [[THUNK_LOC:![0-9]*]] // CHECK-LABEL: define -// CHECK: [[THUNK_VEC_DEL_DTOR:![0-9]*]] = {{.*}} @"\01??_E?$AB@H@@W3AEPAXI@Z", {{.*}}; [ DW_TAG_subprogram ] +// CHECK: [[THUNK_VEC_DEL_DTOR:![0-9]*]] = !MDSubprogram({{.*}}function: {{.*}}@"\01??_E?$AB@H@@W3AEPAXI@Z" // CHECK: [[THUNK_LOC]] = !MDLocation(line: 15, scope: [[THUNK_VEC_DEL_DTOR]]) diff --git a/clang/test/CodeGenCXX/debug-info-zero-length-arrays.cpp b/clang/test/CodeGenCXX/debug-info-zero-length-arrays.cpp index f1ba636..cc3206e 100644 --- a/clang/test/CodeGenCXX/debug-info-zero-length-arrays.cpp +++ b/clang/test/CodeGenCXX/debug-info-zero-length-arrays.cpp @@ -6,7 +6,11 @@ class A { }; A a; -// CHECK: [[ARRAY_TYPE:![0-9]*]]} ; [ DW_TAG_member ] [x] -// CHECK: !"0x1\00\000\000\0032\000\000\000", null, null, {{![0-9]+}}, [[ELEM_TYPE:![0-9]+]], null, null, null} ; [ DW_TAG_array_type ] [line 0, size 0, align 32, offset 0] [from int] +// CHECK: !MDDerivedType(tag: DW_TAG_member, name: "x" +// CHECK-SAME: baseType: [[ARRAY_TYPE:![0-9]+]] +// CHECK: [[ARRAY_TYPE]] = !MDCompositeType(tag: DW_TAG_array_type, +// CHECK-NOT: size: +// CHECK-SAME: align: 32 +// CHECK-SAME: elements: [[ELEM_TYPE:![0-9]+]] // CHECK: [[ELEM_TYPE]] = !{[[SUBRANGE:.*]]} -// CHECK: [[SUBRANGE]] = !{!"0x21\000\00-1"} ; [ DW_TAG_subrange_type ] [unbounded] +// CHECK: [[SUBRANGE]] = !MDSubrange(count: -1) diff --git a/clang/test/CodeGenCXX/debug-info.cpp b/clang/test/CodeGenCXX/debug-info.cpp index b9002f6..bcd78cb 100644 --- a/clang/test/CodeGenCXX/debug-info.cpp +++ b/clang/test/CodeGenCXX/debug-info.cpp @@ -56,17 +56,29 @@ namespace VirtualBase { // CHECK: define void @_ZN7pr147634funcENS_3fooE // CHECK: call void @llvm.dbg.declare({{.*}}, metadata ![[F:.*]], metadata ![[EXPR:.*]]) -// MSVC: [[VBASE_B:![0-9]+]] = distinct !{!"0x13\00B\00{{[0-9]+}}\0096\0032\000\000\000", {{.*}}, null, [[VBASE_B_DEF:![0-9]+]], {{.*}}} ; [ DW_TAG_structure_type ] [B] [line 49, size 96, align 32, offset 0] [def] [from ] +// MSVC: [[VBASE_B:![0-9]+]] = distinct !MDCompositeType(tag: DW_TAG_structure_type, name: "B",{{.*}} line: 49 +// MSVC-SAME: size: 96, align: 32 +// MSVC-NOT: offset: +// MSVC-NOT: DIFlagFwdDecl +// MSVC-SAME: elements: [[VBASE_B_DEF:![0-9]+]] // MSVC: [[VBASE_B_DEF]] = !{[[VBASE_A_IN_B:![0-9]+]], // // Look for the vbtable offset of A, which should be 4. -// MSVC: [[VBASE_A_IN_B]] = !{!"0x1c\00\000\000\000\004\0032", null, [[VBASE_B]], !{{[0-9]*}}} ; [ DW_TAG_inheritance ] [line 0, size 0, align 0, offset 4] [from A] - -// CHECK: !"0x13\00B\00{{[0-9]+}}\00128\0064\000\000\000", {{.*}}, null, [[VBASE_B_DEF:![0-9]+]], {{.*}}} ; [ DW_TAG_structure_type ] [B] [line 49, size 128, align 64, offset 0] [def] [from ] +// MSVC: [[VBASE_A_IN_B]] = !MDDerivedType(tag: DW_TAG_inheritance, scope: [[VBASE_B]], +// MSVC-SAME: baseType: !{{[0-9]*}} + +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "B",{{.*}} line: 49, +// CHECK-SAME: size: 128, align: 64, +// CHECK-NOT: offset: +// CHECK-NOT: DIFlagFwdDecl +// CHECK-SAME: elements: [[VBASE_B_DEF:![^,)]+]] // CHECK: [[VBASE_B_DEF]] = !{[[VBASE_A_IN_B:![0-9]+]], // // Look for the vtable offset offset, which should be -24. -// CHECK: [[VBASE_A_IN_B]] = !{!"0x1c\00\000\000\000\0024\0032", null, !"_ZTSN11VirtualBase1BE", !"_ZTSN11VirtualBase1AE"} ; [ DW_TAG_inheritance ] [line 0, size 0, align 0, offset 24] [from _ZTSN11VirtualBase1AE] +// CHECK: [[VBASE_A_IN_B]] = !MDDerivedType(tag: DW_TAG_inheritance +// CHECK-SAME: scope: !"_ZTSN11VirtualBase1BE" +// CHECK-SAME: baseType: !"_ZTSN11VirtualBase1AE" +// CHECK-SAME: offset: 24, namespace b5249287 { template class A { struct B; @@ -88,15 +100,23 @@ foo func(foo f) { return f; // reference 'f' for now because otherwise we hit another bug } -// CHECK: !"0x13\00{{.*}}", !{{[0-9]*}}, [[PR14763:![0-9]*]], {{.*}}, !"[[FOO:.*]]"} ; [ DW_TAG_structure_type ] [foo] -// CHECK: [[PR14763]] = {{.*}} ; [ DW_TAG_namespace ] [pr14763] -// CHECK: [[INCTYPE:![0-9]*]] = {{.*}} ; [ DW_TAG_structure_type ] [incomplete]{{.*}} [decl] -// CHECK: [[A_MEM:![0-9]*]], null, null, !"_ZTSN7pr162141aE"} ; [ DW_TAG_structure_type ] [a] +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "foo" +// CHECK-SAME: scope: [[PR14763:![0-9]+]] +// CHECK-SAME: identifier: "[[FOO:.*]]" +// CHECK: [[PR14763]] = !MDNamespace(name: "pr14763" +// CHECK: [[INCTYPE:![0-9]*]] = !MDCompositeType(tag: DW_TAG_structure_type, name: "incomplete" +// CHECK-SAME: DIFlagFwdDecl +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "a" +// CHECK-SAME: elements: [[A_MEM:![0-9]+]] +// CHECK-SAME: identifier: "_ZTSN7pr162141aE" // CHECK: [[A_MEM]] = !{[[A_I:![0-9]*]]} -// CHECK: [[A_I]] = {{.*}} ; [ DW_TAG_member ] [i] {{.*}} [from int] -// CHECK: ; [ DW_TAG_structure_type ] [b] {{.*}}[decl] +// CHECK: [[A_I]] = !MDDerivedType(tag: DW_TAG_member, name: "i" +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "b" +// CHECK-SAME: DIFlagFwdDecl -// CHECK: [[FUNC:![0-9]*]] = !{!"0x2e\00func\00func\00_ZN7pr147634funcENS_3fooE\00{{.*}}"{{, [^,]+, [^,]+}}, [[FUNC_TYPE:![0-9]*]], {{.*}} ; [ DW_TAG_subprogram ] {{.*}} [def] [func] +// CHECK: [[FUNC:![0-9]+]] = !MDSubprogram(name: "func", linkageName: "_ZN7pr147634funcENS_3fooE" +// CHECK-SAME: type: [[FUNC_TYPE:![0-9]*]] +// CHECK-SAME: isDefinition: true } void foo() { @@ -104,21 +124,29 @@ void foo() { wchar_t d = c; } -// CHECK-NOT: ; [ DW_TAG_variable ] [c] +// CHECK-NOT: !MDGlobalVariable(name: "c" namespace pr9608 { // also pr9600 struct incomplete; incomplete (*x)[3]; -// CHECK: [[INCARRAYPTR:![0-9]*]], [3 x i8]** @_ZN6pr96081xE, null} ; [ DW_TAG_variable ] [x] -// CHECK: [[INCARRAYPTR]] = {{.*}}[[INCARRAY:![0-9]*]]} ; [ DW_TAG_pointer_type ] -// CHECK: [[INCARRAY]] = !{!"0x1\00\000\000\000\000\000\000", null, null, !"_ZTSN6pr960810incompleteE", {{![0-9]+}}, null, null, null} ; [ DW_TAG_array_type ] [line 0, size 0, align 0, offset 0] [from _ZTSN6pr960810incompleteE] +// CHECK: !MDGlobalVariable(name: "x", linkageName: "_ZN6pr96081xE" +// CHECK-SAME: type: [[INCARRAYPTR:![0-9]*]] +// CHECK-SAME: variable: [3 x i8]** @_ZN6pr96081xE +// CHECK: [[INCARRAYPTR]] = !MDDerivedType(tag: DW_TAG_pointer_type, baseType: [[INCARRAY:![0-9]+]] +// CHECK: [[INCARRAY]] = !MDCompositeType(tag: DW_TAG_array_type +// CHECK-NOT: line: +// CHECK-NOT: size: +// CHECK-NOT: align: +// CHECK-NOT: offset: +// CHECK-SAME: baseType: !"_ZTSN6pr960810incompleteE" } // For some reason function arguments ended up down here -// CHECK: ![[F]] = !{!"0x101\00f\00{{.*}}\000", [[FUNC]], {{![0-9]+}}, !"[[FOO]]"} ; [ DW_TAG_arg_variable ] [f] -// CHECK: ![[EXPR]] = {{.*}} ; [ DW_TAG_expression ] [DW_OP_deref] +// CHECK: ![[F]] = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "f", arg: 1, scope: [[FUNC]] +// CHECK-SAME: type: !"[[FOO]]" +// CHECK: ![[EXPR]] = !MDExpression(DW_OP_deref) -// CHECK: ; [ DW_TAG_auto_variable ] [c] +// CHECK: !MDLocalVariable(tag: DW_TAG_auto_variable, name: "c" namespace pr16214 { struct a { diff --git a/clang/test/CodeGenCXX/debug-lambda-expressions.cpp b/clang/test/CodeGenCXX/debug-lambda-expressions.cpp index ac84036..88951c7 100644 --- a/clang/test/CodeGenCXX/debug-lambda-expressions.cpp +++ b/clang/test/CodeGenCXX/debug-lambda-expressions.cpp @@ -15,52 +15,88 @@ struct D { D(); D(const D&); int x; }; int d(int x) { D y[10]; return [x,y] { return y[x].x; }(); } // Randomness for file. -- 6 -// CHECK: [[FILE:.*]] = {{.*}} [ DW_TAG_file_type ] [{{.*}}debug-lambda-expressions.cpp] +// CHECK: [[FILE:.*]] = !MDFile(filename: "{{.*}}debug-lambda-expressions.cpp", + +// CHECK: ![[INT:[0-9]+]] = !MDBasicType(name: "int" // A: 10 -// CHECK: [[A_FUNC:.*]] = {{.*}} [ DW_TAG_subprogram ] [line [[A_LINE:.*]]] [def] [a] +// CHECK: ![[A_FUNC:.*]] = !MDSubprogram(name: "a"{{.*}}, line: [[A_LINE:[0-9]+]]{{.*}}, isDefinition: true // B: 14 -// CHECK: [[B_FUNC:.*]] = {{.*}} [ DW_TAG_subprogram ] [line [[B_LINE:.*]]] [def] [b] +// CHECK: ![[B_FUNC:.*]] = !MDSubprogram(name: "b"{{.*}}, line: [[B_LINE:[0-9]+]]{{.*}}, isDefinition: true // C: 17 -// CHECK: [[C_FUNC:.*]] = {{.*}} [ DW_TAG_subprogram ] [line [[C_LINE:.*]]] [def] [c] +// CHECK: ![[C_FUNC:.*]] = !MDSubprogram(name: "c"{{.*}}, line: [[C_LINE:[0-9]+]]{{.*}}, isDefinition: true // D: 18 -// CHECK: [[D_FUNC:.*]] = {{.*}} [ DW_TAG_subprogram ] [line [[D_LINE:.*]]] [def] [d] +// CHECK: ![[D_FUNC:.*]] = !MDSubprogram(name: "d"{{.*}}, line: [[D_LINE:[0-9]+]]{{.*}}, isDefinition: true // Back to A. -- 78 -// CHECK: [[LAM_A:.*]] = {{.*}}, [[A_FUNC]], {{.*}}, [[LAM_A_ARGS:.*]], null, null, null} ; [ DW_TAG_class_type ] [line [[A_LINE]], -// CHECK: [[LAM_A_ARGS]] = !{[[CON_LAM_A:.*]]} -// CHECK: [[CON_LAM_A]] = {{.*}}, [[LAM_A]], {{.*}} [ DW_TAG_subprogram ] [line [[A_LINE]]] [public] [operator()] +// CHECK: ![[LAM_A:.*]] = !MDCompositeType(tag: DW_TAG_class_type{{.*}}, scope: ![[A_FUNC]]{{.*}}, line: [[A_LINE]], +// CHECK-SAME: elements: ![[LAM_A_ARGS:[0-9]+]] +// CHECK: ![[LAM_A_ARGS]] = !{![[CON_LAM_A:[0-9]+]]} +// CHECK: ![[CON_LAM_A]] = !MDSubprogram(name: "operator()" +// CHECK-SAME: scope: ![[LAM_A]] +// CHECK-SAME: line: [[A_LINE]] +// CHECK-SAME: DIFlagPublic // Back to B. -- 67 -// CHECK: [[LAM_B:.*]] = {{.*}}, [[B_FUNC]], {{.*}}, [[LAM_B_ARGS:.*]], null, null, null} ; [ DW_TAG_class_type ] [line [[B_LINE]], -// CHECK: [[LAM_B_ARGS]] = !{[[CAP_B:.*]], [[CON_LAM_B:.*]]} -// CHECK: [[CAP_B]] = {{.*}}, [[LAM_B]], {{.*}}} ; [ DW_TAG_member ] [x] [line [[B_LINE]], -// CHECK: [[CON_LAM_B]] = {{.*}}, [[LAM_B]], {{.*}} [ DW_TAG_subprogram ] [line [[B_LINE]]] [public] [operator()] +// CHECK: ![[LAM_B:.*]] = !MDCompositeType(tag: DW_TAG_class_type{{.*}}, scope: ![[B_FUNC]]{{.*}}, line: [[B_LINE]], +// CHECK-SAME: elements: ![[LAM_B_ARGS:[0-9]+]] +// CHECK: ![[LAM_B_ARGS]] = !{![[CAP_B:[0-9]+]], ![[CON_LAM_B:[0-9]+]]} +// CHECK: ![[CAP_B]] = !MDDerivedType(tag: DW_TAG_member, name: "x" +// CHECK-SAME: scope: ![[LAM_B]] +// CHECK-SAME: line: [[B_LINE]], +// CHECK-SAME: baseType: ![[INT]] +// CHECK: ![[CON_LAM_B]] = !MDSubprogram(name: "operator()" +// CHECK-SAME: scope: ![[LAM_B]] +// CHECK-SAME: line: [[B_LINE]] +// CHECK-SAME: DIFlagPublic // Back to C. -- 55 -// CHECK: [[LAM_C:.*]] = {{.*}}, [[C_FUNC]], {{.*}}, [[LAM_C_ARGS:.*]], null, null, null} ; [ DW_TAG_class_type ] [line [[C_LINE]], -// CHECK: [[LAM_C_ARGS]] = !{[[CAP_C:.*]], [[CON_LAM_C:.*]]} -// Ignoring the member type for now. -// CHECK: [[CAP_C]] = {{.*}}, [[LAM_C]], {{.*}}} ; [ DW_TAG_member ] [x] [line [[C_LINE]], -// CHECK: [[CON_LAM_C]] = {{.*}}, [[LAM_C]], {{.*}} [ DW_TAG_subprogram ] [line [[C_LINE]]] [public] [operator()] +// CHECK: ![[LAM_C:.*]] = !MDCompositeType(tag: DW_TAG_class_type{{.*}}, scope: ![[C_FUNC]]{{.*}}, line: [[C_LINE]], +// CHECK-SAME: elements: ![[LAM_C_ARGS:[0-9]+]] +// CHECK: ![[LAM_C_ARGS]] = !{![[CAP_C:[0-9]+]], ![[CON_LAM_C:[0-9]+]]} +// CHECK: ![[CAP_C]] = !MDDerivedType(tag: DW_TAG_member, name: "x" +// CHECK-SAME: scope: ![[LAM_C]] +// CHECK-SAME: line: [[C_LINE]], +// CHECK-SAME: baseType: ![[TYPE_C_x:[0-9]+]] +// CHECK: ![[TYPE_C_x]] = !MDDerivedType(tag: DW_TAG_reference_type, baseType: ![[INT]] +// CHECK: ![[CON_LAM_C]] = !MDSubprogram(name: "operator()" +// CHECK-SAME: scope: ![[LAM_C]] +// CHECK-SAME: line: [[C_LINE]] +// CHECK-SAME: DIFlagPublic // Back to D. -- 24 -// CHECK: [[LAM_D:.*]] = {{.*}}, [[D_FUNC]], {{.*}}, [[LAM_D_ARGS:.*]], null, null, null} ; [ DW_TAG_class_type ] [line [[D_LINE]], -// CHECK: [[LAM_D_ARGS]] = !{[[CAP_D_X:.*]], [[CAP_D_Y:.*]], [[CON_LAM_D:.*]]} -// CHECK: [[CAP_D_X]] = {{.*}}, [[LAM_D]], {{.*}} [ DW_TAG_member ] [x] [line [[D_LINE]], -// CHECK: [[CAP_D_Y]] = {{.*}}, [[LAM_D]], {{.*}} [ DW_TAG_member ] [y] [line [[D_LINE]], -// CHECK: [[CON_LAM_D]] = {{.*}}, [[LAM_D]], {{.*}} [ DW_TAG_subprogram ] [line [[D_LINE]]] [public] [operator()] +// CHECK: ![[LAM_D:.*]] = !MDCompositeType(tag: DW_TAG_class_type{{.*}}, scope: ![[D_FUNC]]{{.*}}, line: [[D_LINE]], +// CHECK-SAME: elements: ![[LAM_D_ARGS:[0-9]+]] +// CHECK: ![[LAM_D_ARGS]] = !{![[CAP_D_X:[0-9]+]], ![[CAP_D_Y:[0-9]+]], ![[CON_LAM_D:[0-9]+]]} +// CHECK: ![[CAP_D_X]] = !MDDerivedType(tag: DW_TAG_member, name: "x" +// CHECK-SAME: scope: ![[LAM_D]] +// CHECK-SAME: line: [[D_LINE]], +// CHECK: ![[CAP_D_Y]] = !MDDerivedType(tag: DW_TAG_member, name: "y" +// CHECK-SAME: scope: ![[LAM_D]] +// CHECK-SAME: line: [[D_LINE]], +// CHECK: ![[CON_LAM_D]] = !MDSubprogram(name: "operator()" +// CHECK-SAME: scope: ![[LAM_D]] +// CHECK-SAME: line: [[D_LINE]] +// CHECK-SAME: DIFlagPublic // CVAR: -// CHECK: {{.*}} [[CVAR_T:![0-9]*]], {{.*}} ; [ DW_TAG_variable ] [cvar] [line [[CVAR_LINE:[0-9]*]]] -// CHECK: [[CVAR_T]] = {{.*}}, ![[CVAR_ARGS:.*]], null, null, null} ; [ DW_TAG_class_type ] [line [[CVAR_LINE]], -// CHECK: [[CVAR_ARGS]] = !{!{{.*}}} +// CHECK: !MDGlobalVariable(name: "cvar" +// CHECK-SAME: line: [[CVAR_LINE:[0-9]+]] +// CHECK-SAME: type: ![[CVAR_T:[0-9]+]] +// CHECK: ![[CVAR_T]] = !MDCompositeType(tag: DW_TAG_class_type +// CHECK-SAME: line: [[CVAR_LINE]], +// CHECK-SAME: elements: ![[CVAR_ARGS:[0-9]+]] +// CHECK: ![[CVAR_ARGS]] = !{!{{[0-9]+}}} // VAR: -// CHECK: {{.*}} [[VAR_T:![0-9]*]], {{.*}} ; [ DW_TAG_variable ] [var] [line [[VAR_LINE:[0-9]*]]] -// CHECK: [[VAR_T]] = {{.*}}, [[VAR_ARGS:![0-9]*]], null, null, null} ; [ DW_TAG_class_type ] [line [[VAR_LINE]], -// CHECK: [[VAR_ARGS]] = !{!{{.*}}} +// CHECK: !MDGlobalVariable(name: "var" +// CHECK-SAME: line: [[VAR_LINE:[0-9]+]] +// CHECK-SAME: type: ![[VAR_T:[0-9]+]] +// CHECK: ![[VAR_T]] = !MDCompositeType(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 87a317d..891470d 100644 --- a/clang/test/CodeGenCXX/debug-lambda-this.cpp +++ b/clang/test/CodeGenCXX/debug-lambda-this.cpp @@ -12,4 +12,10 @@ int D::d(int x) { }(); } -// CHECK: {{.*}} [ DW_TAG_member ] [this] [line 11, size 64, align 64, offset 0] [from ] +// CHECK: !MDDerivedType(tag: DW_TAG_member, name: "this", +// CHECK-SAME: line: 11 +// CHECK-SAME: baseType: ![[POINTER:[0-9]+]] +// CHECK-SAME: size: 64, align: 64 +// CHECK-NOT: offset: 0 +// CHECK-SAME: ){{$}} +// CHECK: ![[POINTER]] = !MDDerivedType(tag: DW_TAG_pointer_type diff --git a/clang/test/CodeGenCXX/field-access-debug-info.cpp b/clang/test/CodeGenCXX/field-access-debug-info.cpp index 2b5b53d..23a27d3 100644 --- a/clang/test/CodeGenCXX/field-access-debug-info.cpp +++ b/clang/test/CodeGenCXX/field-access-debug-info.cpp @@ -1,7 +1,12 @@ // RUN: %clang -g -S -emit-llvm %s -o - | FileCheck %s -// CHECK: [ DW_TAG_member ] [p] [{{[^]]*}}] [public] [from int] -// CHECK: [ DW_TAG_member ] [pr] [{{[^]]*}}] [from int] +// CHECK: !MDDerivedType(tag: DW_TAG_member, name: "p" +// CHECK-SAME: baseType: ![[INT:[0-9]+]] +// CHECK-SAME: DIFlagPublic +// CHECK: ![[INT]] = !MDBasicType(name: "int" +// CHECK: !MDDerivedType(tag: DW_TAG_member, name: "pr" +// CHECK-NOT: flags: +// CHECK-SAME: baseType: ![[INT]] class A { public: diff --git a/clang/test/CodeGenCXX/globalinit-loc.cpp b/clang/test/CodeGenCXX/globalinit-loc.cpp index 583f9c7..69ff77a 100644 --- a/clang/test/CodeGenCXX/globalinit-loc.cpp +++ b/clang/test/CodeGenCXX/globalinit-loc.cpp @@ -6,7 +6,10 @@ // // CHECK: define internal void @_GLOBAL__sub_I_globalinit_loc.cpp // CHECK: !dbg ![[DBG:.*]] -// CHECK: !"0x2e\00\00\00_GLOBAL__sub_I_globalinit_loc.cpp\000\00{{.*}}\000", {{.*}} ; [ DW_TAG_subprogram ] [line 0] [local] [def] +// CHECK: !MDSubprogram(linkageName: "_GLOBAL__sub_I_globalinit_loc.cpp" +// CHECK-NOT: line: +// CHECK-SAME: isLocal: true +// CHECK-SAME: isDefinition: true // CHECK: ![[DBG]] = !MDLocation(line: 0, # 99 "someheader.h" class A { diff --git a/clang/test/CodeGenCXX/inline-dllexport-member.cpp b/clang/test/CodeGenCXX/inline-dllexport-member.cpp index 14634bd..db8216b 100644 --- a/clang/test/CodeGenCXX/inline-dllexport-member.cpp +++ b/clang/test/CodeGenCXX/inline-dllexport-member.cpp @@ -5,6 +5,7 @@ struct __declspec(dllexport) s { static const unsigned int ui = 0; }; -// CHECK: , [[SCOPE:![^,]*]], {{.*}}, i32* @_ZN1s2uiE, {{.*}}} ; [ DW_TAG_variable ] [ui] [line 5] [def] -// CHECK: [[SCOPE]] = {{.*}} ; [ DW_TAG_file_type ] +// CHECK: ![[SCOPE:[0-9]+]] = !MDCompileUnit( +// CHECK: !MDGlobalVariable(name: "ui", linkageName: "_ZN1s2uiE", scope: ![[SCOPE]], +// CHECK-SAME: variable: i32* @_ZN1s2uiE diff --git a/clang/test/CodeGenCXX/linetable-cleanup.cpp b/clang/test/CodeGenCXX/linetable-cleanup.cpp index 0e64be1..67ceecb 100644 --- a/clang/test/CodeGenCXX/linetable-cleanup.cpp +++ b/clang/test/CodeGenCXX/linetable-cleanup.cpp @@ -45,14 +45,14 @@ void bar() void baz() { if (!foo()) - // CHECK: ![[SCOPE1:.*]] = !{!"0xb\00[[@LINE-1]]\00{{.*}}", {{.*}} ; [ DW_TAG_lexical_block ] + // CHECK: ![[SCOPE1:.*]] = distinct !MDLexicalBlock({{.*}}, line: [[@LINE-1]]) // CHECK: {{.*}} = !MDLocation(line: [[@LINE+1]], scope: ![[SCOPE1]]) return; if (foo()) { // no cleanup // CHECK: {{.*}} = !MDLocation(line: [[@LINE+2]], scope: ![[SCOPE2:.*]]) - // CHECK: ![[SCOPE2]] = !{!"0xb\00[[@LINE-3]]\00{{.*}}", {{.*}} ; [ DW_TAG_lexical_block ] + // CHECK: ![[SCOPE2]] = distinct !MDLexicalBlock({{.*}}, line: [[@LINE-3]]) return; } // CHECK: ![[RETBAZ]] = !MDLocation(line: [[@LINE+1]], scope: !{{.*}}) diff --git a/clang/test/CodeGenCXX/linetable-eh.cpp b/clang/test/CodeGenCXX/linetable-eh.cpp index 6d9b3a9..036cfecf 100644 --- a/clang/test/CodeGenCXX/linetable-eh.cpp +++ b/clang/test/CodeGenCXX/linetable-eh.cpp @@ -10,8 +10,8 @@ // CHECK-NEXT: call void @llvm.dbg.declare(metadata {{.*}}, metadata ![[FOUND_IT:.*]], metadata !{{.*}}), !dbg ![[DBG2:.*]] // CHECK: = landingpad // CHECK-NEXT: cleanup, !dbg ![[DBG3:.*]] -// CHECK-DAG: ![[CURRENT_ADDR]] = {{.*}} [current_address] -// CHECK-DAG: ![[FOUND_IT]] = {{.*}} [found_it] +// CHECK-DAG: ![[CURRENT_ADDR]] = {{.*}}name: "current_address" +// CHECK-DAG: ![[FOUND_IT]] = {{.*}}name: "found_it" // CHECK-DAG: ![[DBG1]] = !MDLocation(line: 256, // CHECK-DAG: ![[DBG2]] = !MDLocation(line: 257, // CHECK-DAG: ![[DBG3]] = !MDLocation(line: 268, diff --git a/clang/test/CodeGenCXX/linetable-fnbegin.cpp b/clang/test/CodeGenCXX/linetable-fnbegin.cpp index b0a03f7..f579de1 100644 --- a/clang/test/CodeGenCXX/linetable-fnbegin.cpp +++ b/clang/test/CodeGenCXX/linetable-fnbegin.cpp @@ -4,8 +4,10 @@ // CHECK: define{{.*}}bar // CHECK-NOT: define // CHECK: ret {{.*}}, !dbg [[DBG:.*]] -// CHECK: [[HPP:.*]] = !{!"./template.hpp", -// CHECK: [[SP:.*]] = !{!"0x2e\00{{.*}}", [[HPP]],{{.*}}[ DW_TAG_subprogram ] [line 22] [def] [bar] +// CHECK: [[HPP:.*]] = !MDFile(filename: "./template.hpp", +// CHECK: [[SP:.*]] = !MDSubprogram(name: "bar", +// CHECK-SAME: file: [[HPP]], line: 22 +// CHECK-SAME: isDefinition: true // We shouldn't need a lexical block for this function. // CHECK: [[DBG]] = !MDLocation(line: 23, scope: [[SP]]) diff --git a/clang/test/CodeGenCXX/scoped-enums-debug-info.cpp b/clang/test/CodeGenCXX/scoped-enums-debug-info.cpp index d3ef9f7..18f4278 100644 --- a/clang/test/CodeGenCXX/scoped-enums-debug-info.cpp +++ b/clang/test/CodeGenCXX/scoped-enums-debug-info.cpp @@ -1,7 +1,9 @@ // RUN: %clang_cc1 -std=c++11 -emit-llvm -g -o - %s | FileCheck %s // Test that we are emitting debug info and base types for scoped enums. -// CHECK: [ DW_TAG_enumeration_type ] [Color] {{.*}} [from int] +// CHECK: !MDCompositeType(tag: DW_TAG_enumeration_type, name: "Color" +// CHECK-SAME: baseType: ![[INT:[0-9]+]] +// CHECK: ![[INT]] = !MDBasicType(name: "int" enum class Color { gray }; void f(Color); @@ -9,7 +11,8 @@ void g() { f(Color::gray); } -// CHECK: [ DW_TAG_enumeration_type ] [Colour] {{.*}} [from int] +// CHECK: !MDCompositeType(tag: DW_TAG_enumeration_type, name: "Colour" +// CHECK-SAME: baseType: ![[INT]] enum struct Colour { grey }; void h(Colour); @@ -17,7 +20,9 @@ void i() { h(Colour::grey); } -// CHECK: [ DW_TAG_enumeration_type ] [Couleur] {{.*}} [from unsigned char] +// CHECK: !MDCompositeType(tag: DW_TAG_enumeration_type, name: "Couleur" +// CHECK-SAME: baseType: ![[UCHAR:[0-9]+]] +// CHECK: ![[UCHAR]] = !MDBasicType(name: "unsigned char" enum class Couleur : unsigned char { gris }; void j(Couleur); diff --git a/clang/test/CodeGenCXX/vtable-holder-self-reference.cpp b/clang/test/CodeGenCXX/vtable-holder-self-reference.cpp index 05e6d71..83d081b 100644 --- a/clang/test/CodeGenCXX/vtable-holder-self-reference.cpp +++ b/clang/test/CodeGenCXX/vtable-holder-self-reference.cpp @@ -4,7 +4,8 @@ // rid of self-referenceing structure_types (PR21902), then it should be safe // to just kill this test. // -// CHECK: ![[SELF:[0-9]+]] = distinct !{!"0x13\00B\00{{[^"]*}}", {{[^,]+}}, {{[^,]+}}, {{[^,]+}}, {{[^,]+}}, ![[SELF]], {{[^}]+}}} ; [ DW_TAG_structure_type ] [B] +// CHECK: ![[SELF:[0-9]+]] = distinct !MDCompositeType(tag: DW_TAG_structure_type, name: "B", +// CHECK-SAME: vtableHolder: ![[SELF]] void foo() { struct V { diff --git a/clang/test/CodeGenObjC/2010-02-09-DbgSelf.m b/clang/test/CodeGenObjC/2010-02-09-DbgSelf.m index d70b3d6..695a964 100644 --- a/clang/test/CodeGenObjC/2010-02-09-DbgSelf.m +++ b/clang/test/CodeGenObjC/2010-02-09-DbgSelf.m @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -x objective-c -emit-llvm -g < %s | FileCheck %s // Test to check that "self" argument is assigned a location. // CHECK: call void @llvm.dbg.declare(metadata %0** %{{[^,]+}}, metadata [[SELF:![0-9]*]], metadata !{{.*}}) -// CHECK: [[SELF]] = {{.*}} ; [ DW_TAG_arg_variable ] [self] +// CHECK: [[SELF]] = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "self" @interface Foo -(void) Bar: (int)x ; diff --git a/clang/test/CodeGenObjC/2010-02-15-Dbg-MethodStart.m b/clang/test/CodeGenObjC/2010-02-15-Dbg-MethodStart.m index 3fb98c5..7cac8f1 100644 --- a/clang/test/CodeGenObjC/2010-02-15-Dbg-MethodStart.m +++ b/clang/test/CodeGenObjC/2010-02-15-Dbg-MethodStart.m @@ -7,7 +7,7 @@ @implementation Foo -(int) barMethod { -// CHECK: [ DW_TAG_subprogram ] [line [[@LINE-1]]] + // CHECK: !MDSubprogram({{.*}}line: [[@LINE-1]] int i = 0; int j = 1; int k = 1; diff --git a/clang/test/CodeGenObjC/arc-linetable.m b/clang/test/CodeGenObjC/arc-linetable.m index cd746d1..5a9eda9 100644 --- a/clang/test/CodeGenObjC/arc-linetable.m +++ b/clang/test/CodeGenObjC/arc-linetable.m @@ -54,7 +54,9 @@ typedef signed char BOOL; @implementation AppDelegate : NSObject -// CHECK: ![[TESTNOSIDEEFFECT:.*]] = {{.*}}[ DW_TAG_subprogram ] [line [[@LINE+1]]] [local] [def] [-[AppDelegate testNoSideEffect:]] +// CHECK: ![[TESTNOSIDEEFFECT:.*]] = !MDSubprogram(name: "-[AppDelegate testNoSideEffect:]" +// CHECK-SAME: line: [[@LINE+2]] +// CHECK-SAME: isLocal: true, isDefinition: true - (int)testNoSideEffect:(NSString *)foo { int x = 1; return 1; // Return expression diff --git a/clang/test/CodeGenObjC/block-byref-debuginfo.m b/clang/test/CodeGenObjC/block-byref-debuginfo.m index 231767e..dc8379b 100644 --- a/clang/test/CodeGenObjC/block-byref-debuginfo.m +++ b/clang/test/CodeGenObjC/block-byref-debuginfo.m @@ -3,7 +3,10 @@ // rdar://problem/14386148 // Test that the foo is aligned at an 8 byte boundary in the DWARF // expression (256) that locates it inside of the byref descriptor: -// CHECK: [ DW_TAG_member ] [foo] [line 0, size {{[0-9]+}}, align 64, offset 256] [from Foo] +// CHECK: !MDDerivedType(tag: DW_TAG_member, name: "foo", +// CHECK-NOT: line: +// CHECK-SAME: align: 64 +// CHECK-SAME: offset: 256 struct Foo { unsigned char *data; diff --git a/clang/test/CodeGenObjC/catch-lexical-block.m b/clang/test/CodeGenObjC/catch-lexical-block.m index d5aeee1..5ff184a 100644 --- a/clang/test/CodeGenObjC/catch-lexical-block.m +++ b/clang/test/CodeGenObjC/catch-lexical-block.m @@ -9,7 +9,7 @@ void f0() { // We should have 3 lexical blocks here at the moment, including one // for the catch block. -// CHECK: lexical_block -// CHECK: auto_variable -// CHECK: lexical_block -// CHECK: lexical_block +// CHECK: !MDLexicalBlock( +// CHECK: !MDLocalVariable(tag: DW_TAG_auto_variable +// CHECK: !MDLexicalBlock( +// CHECK: !MDLexicalBlock( diff --git a/clang/test/CodeGenObjC/debug-info-block-captured-self.m b/clang/test/CodeGenObjC/debug-info-block-captured-self.m index 70c9488..ccddbef 100644 --- a/clang/test/CodeGenObjC/debug-info-block-captured-self.m +++ b/clang/test/CodeGenObjC/debug-info-block-captured-self.m @@ -63,7 +63,9 @@ typedef enum { // make sure we are still in the same function // CHECK: define {{.*}}__copy_helper_block_ // Metadata -// CHECK: ![[MAIN:.*]] = !{!"0x13\00Main\0023\00{{.*}}", {{.*}} ; [ DW_TAG_structure_type ] [Main] [line 23, -// CHECK: ![[PMAIN:.*]] = {{.*}}![[MAIN]]} ; [ DW_TAG_pointer_type ]{{.*}}from Main -// CHECK: ![[BDMD]] = {{.*}}.block_descriptor -// CHECK: ![[SELF]] = {{.*}}![[PMAIN]]{{.*}}[ DW_TAG_auto_variable ] [self] [line 40] +// CHECK: ![[MAIN:.*]] = !MDCompositeType(tag: DW_TAG_structure_type, name: "Main" +// CHECK-SAME: line: 23, +// CHECK: ![[PMAIN:.*]] = !MDDerivedType(tag: DW_TAG_pointer_type, baseType: ![[MAIN]], +// CHECK: ![[BDMD]] = !MDLocalVariable(tag: DW_TAG_arg_variable, name: ".block_descriptor" +// CHECK: ![[SELF]] = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "self" +// CHECK-SAME: line: 40, diff --git a/clang/test/CodeGenObjC/debug-info-block-helper.m b/clang/test/CodeGenObjC/debug-info-block-helper.m index 1403327..dc57c68 100644 --- a/clang/test/CodeGenObjC/debug-info-block-helper.m +++ b/clang/test/CodeGenObjC/debug-info-block-helper.m @@ -2,7 +2,7 @@ // RUN: %clang_cc1 -emit-llvm -fblocks -g -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 %s -o - | FileCheck %s extern void foo(void(^)(void)); -// CHECK: [ DW_TAG_subprogram ] {{.*}} [__destroy_helper_block_] +// CHECK: !MDSubprogram(name: "__destroy_helper_block_" @interface NSObject { struct objc_object *isa; diff --git a/clang/test/CodeGenObjC/debug-info-block-type.m b/clang/test/CodeGenObjC/debug-info-block-type.m index ef92bf3..018c4c6 100644 --- a/clang/test/CodeGenObjC/debug-info-block-type.m +++ b/clang/test/CodeGenObjC/debug-info-block-type.m @@ -1,18 +1,23 @@ // RUN: %clang_cc1 -emit-llvm -fblocks -g -triple x86_64-apple-darwin14 -x objective-c < %s -o - | FileCheck %s #define nil ((void*) 0) typedef signed char BOOL; -// CHECK: ![[BOOL:[0-9]+]] = {{.*}} [ DW_TAG_typedef ] [BOOL] [line [[@LINE-1]] -// CHECK: ![[ID:[0-9]+]] = {{.*}} [ DW_TAG_typedef ] [id] +// CHECK: ![[BOOL:[0-9]+]] = !MDDerivedType(tag: DW_TAG_typedef, name: "BOOL" +// CHECK-SAME: line: [[@LINE-2]] +// CHECK: ![[ID:[0-9]+]] = !MDDerivedType(tag: DW_TAG_typedef, name: "id" typedef BOOL (^SomeKindOfPredicate)(id obj); -// CHECK: ![[PTR:[0-9]+]]} ; [ DW_TAG_member ] [__FuncPtr] -// CHECK: ![[PTR]] = {{.*}}, ![[FNTYPE:[0-9]+]]} ; [ DW_TAG_pointer_type ] -// CHECK: ![[FNTYPE]] = {{.*}} ![[ARGS:[0-9]+]]{{.*}} ; [ DW_TAG_subroutine_type ] +// CHECK: !MDDerivedType(tag: DW_TAG_member, name: "__FuncPtr" +// CHECK-SAME: baseType: ![[PTR:[0-9]+]] +// CHECK: ![[PTR]] = !MDDerivedType(tag: DW_TAG_pointer_type, +// CHECK-SAME: baseType: ![[FNTYPE:[0-9]+]] +// CHECK: ![[FNTYPE]] = !MDSubroutineType(types: ![[ARGS:[0-9]+]]) // CHECK: ![[ARGS]] = !{![[BOOL]], ![[ID]]} int main() { SomeKindOfPredicate p = ^BOOL(id obj) { return obj != nil; }; - // CHECK: ![[PTR]]} ; [ DW_TAG_member ] [__FuncPtr] [line [[@LINE-1]], size 64, align 64, offset 128] + // CHECK: !MDDerivedType(tag: DW_TAG_member, name: "__FuncPtr", + // CHECK-SAME: line: [[@LINE-2]] + // CHECK-SAME: size: 64, align: 64, offset: 128, return p(nil); } diff --git a/clang/test/CodeGenObjC/debug-info-blocks.m b/clang/test/CodeGenObjC/debug-info-blocks.m index f5f4437..7e425f8 100644 --- a/clang/test/CodeGenObjC/debug-info-blocks.m +++ b/clang/test/CodeGenObjC/debug-info-blocks.m @@ -24,9 +24,9 @@ // CHECK-DAG: [[DBG_LINE]] = !MDLocation(line: 0, scope: ![[COPY_SP:[0-9]+]]) // CHECK-DAG: [[COPY_LINE]] = !MDLocation(line: 0, scope: ![[COPY_SP:[0-9]+]]) -// CHECK-DAG: [[COPY_SP]] = {{.*}}[ DW_TAG_subprogram ]{{.*}}[__copy_helper_block_] +// CHECK-DAG: [[COPY_SP]] = !MDSubprogram(name: "__copy_helper_block_" // CHECK-DAG: [[DESTROY_LINE]] = !MDLocation(line: 0, scope: ![[DESTROY_SP:[0-9]+]]) -// CHECK-DAG: [[DESTROY_SP]] = {{.*}}[ DW_TAG_subprogram ]{{.*}}[__destroy_helper_block_] +// CHECK-DAG: [[DESTROY_SP]] = !MDSubprogram(name: "__destroy_helper_block_" typedef unsigned int NSUInteger; @protocol NSObject @@ -61,8 +61,8 @@ static void run(void (^block)(void)) { if ((self = [super init])) { run(^{ - // CHECK-DAG: ![[SELF]] = {{.*}} [ DW_TAG_auto_variable ] [self] [line [[@LINE+4]]] - // CHECK-DAG: ![[D]] = {{.*}} [d] [line [[@LINE+1]]] + // CHECK-DAG: ![[SELF]] = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "self"{{.*}}, line: [[@LINE+4]], + // CHECK-DAG: ![[D]] = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "d"{{.*}}, line: [[@LINE+1]], NSMutableDictionary *d = [[NSMutableDictionary alloc] init]; ivar = 42 + (int)[d count]; }); diff --git a/clang/test/CodeGenObjC/debug-info-fwddecl.m b/clang/test/CodeGenObjC/debug-info-fwddecl.m index b43d7c0..8291d47 100644 --- a/clang/test/CodeGenObjC/debug-info-fwddecl.m +++ b/clang/test/CodeGenObjC/debug-info-fwddecl.m @@ -2,4 +2,9 @@ @class ForwardObjcClass; ForwardObjcClass *ptr = 0; -// CHECK: {{.*}} [ DW_TAG_structure_type ] [ForwardObjcClass] [line 2, size 0, align 0, offset 0] [decl] +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "ForwardObjcClass" +// CHECK-SAME: line: 2 +// CHECK-NOT: size: +// CHECK-NOT: align: +// CHECK-NOT: offset: +// CHECK-SAME: flags: DIFlagFwdDecl diff --git a/clang/test/CodeGenObjC/debug-info-getter-name.m b/clang/test/CodeGenObjC/debug-info-getter-name.m index 9e1e55f..5fd022e 100644 --- a/clang/test/CodeGenObjC/debug-info-getter-name.m +++ b/clang/test/CodeGenObjC/debug-info-getter-name.m @@ -1,7 +1,7 @@ // REQUIRES: x86-registered-target // RUN: %clang_cc1 -emit-llvm -triple x86_64-apple-darwin10 -fexceptions -fobjc-exceptions -g %s -o - | FileCheck %s -// CHECK: !"0x2e\00-[InstanceVariablesEverywhereButTheInterface someString]\00{{.*}}", {{.*}} ; [ DW_TAG_subprogram ] +// CHECK: !MDSubprogram(name: "-[InstanceVariablesEverywhereButTheInterface someString]" //rdar: //8498026 diff --git a/clang/test/CodeGenObjC/debug-info-id-with-protocol.m b/clang/test/CodeGenObjC/debug-info-id-with-protocol.m index 9233f6c..c3b88d7 100644 --- a/clang/test/CodeGenObjC/debug-info-id-with-protocol.m +++ b/clang/test/CodeGenObjC/debug-info-id-with-protocol.m @@ -36,7 +36,12 @@ int main() } } // Verify that the debug type for both variables is 'id'. -// CHECK: !"0x101\00bad_carrier\00{{[0-9]+}}\000", !{{[0-9]+}}, null, ![[IDTYPE:[0-9]+]]} ; [ DW_TAG_arg_variable ] [bad_carrier] [line 0] +// CHECK: ![[IDTYPE:[0-9]+]] = !MDDerivedType(tag: DW_TAG_typedef, name: "id" // -// CHECK: !"0x101\00good_carrier\00{{[0-9]+}}\000", !{{[0-9]+}}, null, ![[IDTYPE]]} ; [ DW_TAG_arg_variable ] [good_carrier] [line 0] -// CHECK !{{.*}}[[IDTYPE]] = !{!"0x16\00id\00{{[0-9]+}}\000\000\000\000", null, !{{[0-9]+}}, !{{[0-9]+}}} ; [ DW_TAG_typedef ] [id] +// CHECK: !MDLocalVariable(tag: DW_TAG_arg_variable, name: "bad_carrier" +// CHECK-NOT: line: +// CHECK-SAME: type: ![[IDTYPE]] +// +// CHECK: !MDLocalVariable(tag: DW_TAG_arg_variable, name: "good_carrier" +// CHECK-NOT: line: +// CHECK-SAME: type: ![[IDTYPE]] diff --git a/clang/test/CodeGenObjC/debug-info-impl.m b/clang/test/CodeGenObjC/debug-info-impl.m index 8991a88..4e56988 100644 --- a/clang/test/CodeGenObjC/debug-info-impl.m +++ b/clang/test/CodeGenObjC/debug-info-impl.m @@ -1,5 +1,4 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -g -S -emit-llvm %s -o - | FileCheck %s -// CHECK: {{.*}} [ DW_TAG_structure_type ] [Circle] [line 11, @interface NSObject { struct objc_object *isa; } @@ -8,6 +7,8 @@ @interface Shape : NSObject @end +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "Circle" +// CHECK-SAME: line: [[@LINE+1]], @interface Circle : Shape @end diff --git a/clang/test/CodeGenObjC/debug-info-instancetype.m b/clang/test/CodeGenObjC/debug-info-instancetype.m index 07fd5ca..a055367 100644 --- a/clang/test/CodeGenObjC/debug-info-instancetype.m +++ b/clang/test/CodeGenObjC/debug-info-instancetype.m @@ -13,11 +13,14 @@ @implementation Foo +(instancetype)defaultFoo {return 0;} -// CHECK: ![[FOO:[0-9]+]] = {{.*}}; [ DW_TAG_structure_type ] [Foo] -// CHECK: !"0x2e\00+[Foo defaultFoo]\00+[Foo defaultFoo]\00\00[[@LINE-2]]\00{{[^,]*}}"{{, [^,]+, [^,]+}}, ![[TYPE:[0-9]+]] -// CHECK: ![[TYPE]] = {{.*}} ![[RESULT:[0-9]+]], null, null, null} ; [ DW_TAG_subroutine_type ] -// CHECK: ![[RESULT]] = {{.*}}{![[FOOPTR:[0-9]+]], -// CHECK: ![[FOOPTR]] = {{.*}}, ![[FOO]]}{{.*}}[ DW_TAG_pointer_type ] {{.*}} [from Foo] +// CHECK: ![[FOO:[0-9]+]] = !MDCompositeType(tag: DW_TAG_structure_type, name: "Foo" +// CHECK: !MDSubprogram(name: "+[Foo defaultFoo]" +// CHECK-SAME: line: [[@LINE-3]] +// CHECK-SAME: type: ![[TYPE:[0-9]+]] +// CHECK: ![[TYPE]] = !MDSubroutineType(types: ![[RESULT:[0-9]+]]) +// CHECK: ![[RESULT]] = !{![[FOOPTR:[0-9]+]], +// CHECK: ![[FOOPTR]] = !MDDerivedType(tag: DW_TAG_pointer_type +// CHECK-SAME: baseType: ![[FOO]] @end diff --git a/clang/test/CodeGenObjC/debug-info-ivars-extension.m b/clang/test/CodeGenObjC/debug-info-ivars-extension.m index 9dd7152..187a6df 100644 --- a/clang/test/CodeGenObjC/debug-info-ivars-extension.m +++ b/clang/test/CodeGenObjC/debug-info-ivars-extension.m @@ -24,10 +24,24 @@ void gorf (I* pg) { int _b = pg->b; } -// CHECK: {{.*}} [ DW_TAG_structure_type ] [I] +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "I" + // Check for "a". -// CHECK: {{.*}} [ DW_TAG_member ] [a] [line 7, size 32, align 32, offset 0] [public] [from int] +// CHECK: !MDDerivedType(tag: DW_TAG_member, name: "a" +// CHECK-SAME: line: 7 +// CHECK-SAME: baseType: ![[INT:[0-9]+]] +// CHECK-SAME: size: 32, align: 32 +// CHECK-NOT: offset: +// CHECK-SAME: flags: DIFlagPublic +// CHECK: ![[INT]] = !MDBasicType(name: "int" + // Make sure we don't output the same type twice. -// CHECK-NOT: {{.*}} [ DW_TAG_structure_type ] [I] +// CHECK-NOT: !MDCompositeType(tag: DW_TAG_structure_type, name: "I" + // Check for "b". -// CHECK: {{.*}} [ DW_TAG_member ] [b] [line 18, size 32, align 32, offset 0] [public] [from int] +// CHECK: !MDDerivedType(tag: DW_TAG_member, name: "b" +// CHECK-SAME: line: 18 +// CHECK-SAME: baseType: ![[INT]] +// CHECK-SAME: size: 32, align: 32 +// CHECK-NOT: offset: +// CHECK-SAME: flags: DIFlagPublic diff --git a/clang/test/CodeGenObjC/debug-info-ivars-indirect.m b/clang/test/CodeGenObjC/debug-info-ivars-indirect.m index f9593d2..0ef350a 100644 --- a/clang/test/CodeGenObjC/debug-info-ivars-indirect.m +++ b/clang/test/CodeGenObjC/debug-info-ivars-indirect.m @@ -6,10 +6,10 @@ // This happens to be the order the members are emitted in... I'm assuming it's // not meaningful/important, so if something causes the order to change, feel // free to update the test to reflect the new order. -// CHECK: ; [ DW_TAG_member ] [a] -// CHECK: ; [ DW_TAG_member ] [d] -// CHECK: ; [ DW_TAG_member ] [c] -// CHECK: ; [ DW_TAG_member ] [b] +// CHECK: !MDDerivedType(tag: DW_TAG_member, name: "a" +// CHECK: !MDDerivedType(tag: DW_TAG_member, name: "d" +// CHECK: !MDDerivedType(tag: DW_TAG_member, name: "c" +// CHECK: !MDDerivedType(tag: DW_TAG_member, name: "b" @interface I { diff --git a/clang/test/CodeGenObjC/debug-info-ivars-private.m b/clang/test/CodeGenObjC/debug-info-ivars-private.m index 8505da1..7fec4b5 100644 --- a/clang/test/CodeGenObjC/debug-info-ivars-private.m +++ b/clang/test/CodeGenObjC/debug-info-ivars-private.m @@ -32,5 +32,16 @@ __attribute((objc_root_class)) @interface NSObject { } @end -// CHECK: {{.*}} [ DW_TAG_member ] [foo] [line 14, size 32, align 32, offset 0] [protected] [from int] -// CHECK: {{.*}} [ DW_TAG_member ] [bar] [line 27, size 32, align 32, offset 0] [private] [from int] +// CHECK: !MDDerivedType(tag: DW_TAG_member, name: "foo" +// CHECK-SAME: line: 14 +// CHECK-SAME: baseType: ![[INT:[0-9]+]] +// CHECK-SAME: size: 32, align: 32, +// CHECK-NOT: offset: +// CHECK-SAME: flags: DIFlagProtected +// CHECK: ![[INT]] = !MDBasicType(name: "int" +// CHECK: !MDDerivedType(tag: DW_TAG_member, name: "bar" +// CHECK-SAME: line: 27 +// CHECK-SAME: baseType: ![[INT:[0-9]+]] +// CHECK-SAME: size: 32, align: 32, +// CHECK-NOT: offset: +// CHECK-SAME: flags: DIFlagPrivate diff --git a/clang/test/CodeGenObjC/debug-info-ivars.m b/clang/test/CodeGenObjC/debug-info-ivars.m index a0f2963..a6d8886 100644 --- a/clang/test/CodeGenObjC/debug-info-ivars.m +++ b/clang/test/CodeGenObjC/debug-info-ivars.m @@ -18,7 +18,27 @@ __attribute((objc_root_class)) @interface NSObject { @implementation BaseClass @end -// CHECK: {{.*}} [ DW_TAG_member ] [i] [line 10, size 32, align 32, offset 0] [protected] [from int] -// CHECK: {{.*}} [ DW_TAG_member ] [flag_1] [line 11, size 9, align 32, offset 0] [protected] [from unsigned int] -// CHECK: {{.*}} [ DW_TAG_member ] [flag_2] [line 12, size 9, align 32, offset 1] [protected] [from unsigned int] -// CHECK: {{.*}} [ DW_TAG_member ] [flag_3] [line 14, size 9, align 32, offset 3] [protected] [from unsigned int] +// CHECK: !MDDerivedType(tag: DW_TAG_member, name: "i" +// CHECK-SAME: line: 10 +// CHECK-SAME: baseType: ![[INT:[0-9]+]] +// CHECK-SAME: size: 32, align: 32, +// CHECK-NOT: offset: +// CHECK-SAME: flags: DIFlagProtected +// CHECK: ![[INT]] = !MDBasicType(name: "int" +// CHECK: !MDDerivedType(tag: DW_TAG_member, name: "flag_1" +// CHECK-SAME: line: 11 +// CHECK-SAME: baseType: ![[UNSIGNED:[0-9]+]] +// CHECK-SAME: size: 9, align: 32, +// CHECK-NOT: offset: +// CHECK-SAME: flags: DIFlagProtected +// CHECK: ![[UNSIGNED]] = !MDBasicType(name: "unsigned int" +// CHECK: !MDDerivedType(tag: DW_TAG_member, name: "flag_2" +// CHECK-SAME: line: 12 +// CHECK-SAME: baseType: ![[UNSIGNED]] +// CHECK-SAME: size: 9, align: 32, offset: 1, +// CHECK-SAME: flags: DIFlagProtected +// CHECK: !MDDerivedType(tag: DW_TAG_member, name: "flag_3" +// CHECK-SAME: line: 14 +// CHECK-SAME: baseType: ![[UNSIGNED]] +// CHECK-SAME: size: 9, align: 32, offset: 3, +// CHECK-SAME: flags: DIFlagProtected diff --git a/clang/test/CodeGenObjC/debug-info-lifetime-crash.m b/clang/test/CodeGenObjC/debug-info-lifetime-crash.m index e2e5d7e..67285ce 100644 --- a/clang/test/CodeGenObjC/debug-info-lifetime-crash.m +++ b/clang/test/CodeGenObjC/debug-info-lifetime-crash.m @@ -13,10 +13,14 @@ { // The debug type for these two will be identical, because we do not // actually emit the ownership qualifier. - // CHECK-DAG: !"0x100\00weakSelf\00[[@LINE+1]]\000"{{, [^,]+, [^,]+}}, ![[SELFTY:[0-9]+]]} ; [ DW_TAG_auto_variable ] [weakSelf] + // CHECK: !MDLocalVariable(tag: DW_TAG_auto_variable, name: "weakSelf", + // CHECK-SAME: line: [[@LINE+2]] + // CHECK-SAME: type: ![[SELFTY:[0-9]+]] __attribute__((objc_ownership(weak))) __typeof(self) weakSelf = self; Block = [^{ - // CHECK-DAG: !"0x100\00strongSelf\00[[@LINE+1]]\000"{{, [^,]+, [^,]+}}, ![[SELFTY]]} ; [ DW_TAG_auto_variable ] [strongSelf] + // CHECK: !MDLocalVariable(tag: DW_TAG_auto_variable, name: "strongSelf", + // CHECK-SAME: line: [[@LINE+2]] + // CHECK-SAME: type: ![[SELFTY]] __attribute__((objc_ownership(strong))) __typeof(self) strongSelf = weakSelf; } copy]; } diff --git a/clang/test/CodeGenObjC/debug-info-property-accessors.m b/clang/test/CodeGenObjC/debug-info-property-accessors.m index 0c7f03e..01fbe58 100644 --- a/clang/test/CodeGenObjC/debug-info-property-accessors.m +++ b/clang/test/CodeGenObjC/debug-info-property-accessors.m @@ -5,7 +5,8 @@ // Ensure we emit the names of explicit/renamed accessors even if they // are defined later in the implementation section. // -// CHECK: !"0x4200\00blah\00{{[0-9]+}}\00isBlah\00{{.*}}", {{.*}}} ; [ DW_TAG_APPLE_property ] [blah] +// CHECK: !MDObjCProperty(name: "blah" +// CHECK-SAME: getter: "isBlah" @class NSString; extern void NSLog(NSString *format, ...); diff --git a/clang/test/CodeGenObjC/debug-info-property3.m b/clang/test/CodeGenObjC/debug-info-property3.m index a6d8daf..1b95998 100644 --- a/clang/test/CodeGenObjC/debug-info-property3.m +++ b/clang/test/CodeGenObjC/debug-info-property3.m @@ -1,7 +1,9 @@ // RUN: %clang_cc1 -S -emit-llvm -g %s -o - | FileCheck %s -// CHECK: !"0x4200\00p1\005\00\00\002316", {{.*}}} ; [ DW_TAG_APPLE_property ] @interface I1 +// CHECK: !MDObjCProperty(name: "p1" +// CHECK-SAME: line: [[@LINE+2]] +// CHECK-SAME: attributes: 2316 @property int p1; @end diff --git a/clang/test/CodeGenObjC/debug-info-pubtypes.m b/clang/test/CodeGenObjC/debug-info-pubtypes.m index 845b946..dd30f6c 100644 --- a/clang/test/CodeGenObjC/debug-info-pubtypes.m +++ b/clang/test/CodeGenObjC/debug-info-pubtypes.m @@ -1,8 +1,8 @@ // REQUIRES: x86-registered-target // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -g -emit-llvm %s -o - | FileCheck %s -// CHECK: {{.*}} [ DW_TAG_structure_type ] [H] [line 6, - +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "H" +// CHECK-SAME: line: [[@LINE+1]], @interface H -(void) foo; @end diff --git a/clang/test/CodeGenObjC/debug-info-self.m b/clang/test/CodeGenObjC/debug-info-self.m index a6e9daf..58a753c 100644 --- a/clang/test/CodeGenObjC/debug-info-self.m +++ b/clang/test/CodeGenObjC/debug-info-self.m @@ -14,6 +14,16 @@ } @end -// CHECK: !"0x101\00self\0016777216\001088", ![[CTOR:.*]], null, !{{.*}}} ; [ DW_TAG_arg_variable ] [self] [line 0] -// CHECK: !"0x101\00_cmd\0033554432\0064", ![[CTOR]], null, !{{.*}}} ; [ DW_TAG_arg_variable ] [_cmd] [line 0] -// CHECK: !"0x101\00myarg\0050331659\000", ![[CTOR]], !{{.*}}, !{{.*}}} ; [ DW_TAG_arg_variable ] [myarg] [line 11] +// CHECK: !MDLocalVariable(tag: DW_TAG_arg_variable, name: "self", arg: 1, +// CHECK-SAME: scope: ![[CTOR:[0-9]+]] +// CHECK-NOT: line: +// CHECK-SAME: flags: DIFlagArtificial | DIFlagObjectPointer{{[,)]}} +// CHECK: !MDLocalVariable(tag: DW_TAG_arg_variable, name: "_cmd", arg: 2, +// CHECK-SAME: scope: ![[CTOR]] +// CHECK-NOT: line: +// CHECK-SAME: flags: DIFlagArtificial{{[,)]}} +// CHECK: !MDLocalVariable(tag: DW_TAG_arg_variable, name: "myarg", arg: 3, +// CHECK-SAME: scope: ![[CTOR]] +// CHECK-SAME: line: 11 +// CHECK-NOT: flags: +// CHECK-SAME: ){{$}} diff --git a/clang/test/CodeGenObjC/debug-info-static-var.m b/clang/test/CodeGenObjC/debug-info-static-var.m index 6828983..ac615d8 100644 --- a/clang/test/CodeGenObjC/debug-info-static-var.m +++ b/clang/test/CodeGenObjC/debug-info-static-var.m @@ -2,7 +2,9 @@ // Radar 8801045 // Do not emit AT_MIPS_linkage_name for static variable i -// CHECK: !"0x34\00i\00i\00\00{{.*}}" +// CHECK: !MDGlobalVariable(name: "i" +// CHECK-NOT: linkageName: +// CHECK-SAME: ){{$}} @interface A { } diff --git a/clang/test/CodeGenObjC/debug-info-synthesis.m b/clang/test/CodeGenObjC/debug-info-synthesis.m index 55867b4..ad9bea7 100644 --- a/clang/test/CodeGenObjC/debug-info-synthesis.m +++ b/clang/test/CodeGenObjC/debug-info-synthesis.m @@ -30,5 +30,8 @@ int main(int argc, char *argv[]) { } } -// CHECK: ![[FILE:.*]] = {{.*}}[ DW_TAG_file_type ] [{{.*}}/foo.h] -// CHECK: ![[FILE]], {{.*}} ; [ DW_TAG_subprogram ] [line 8] [local] [def] [-[Foo dict]] +// CHECK: ![[FILE:.*]] = !MDFile(filename: "{{[^"]+}}foo.h" +// CHECK: !MDSubprogram(name: "-[Foo setDict:]" +// CHECK-SAME: file: ![[FILE]], +// CHECK-SAME: line: 8, +// CHECK-SAME: isLocal: true, isDefinition: true diff --git a/clang/test/CodeGenObjC/debug-info-variadic-method.m b/clang/test/CodeGenObjC/debug-info-variadic-method.m index e895953..7f9ad27 100644 --- a/clang/test/CodeGenObjC/debug-info-variadic-method.m +++ b/clang/test/CodeGenObjC/debug-info-variadic-method.m @@ -10,7 +10,7 @@ @implementation Foo - (void) Bar: (int) n, ... { - // CHECK: ![[NUM:[^,]*]], null, null, null} ; [ DW_TAG_subroutine_type ] - // CHECK: ![[NUM]] = {{!{null, ![^,]*, ![^,]*, ![^,]*, null}}} + // CHECK: !MDSubroutineType(types: ![[NUM:[0-9]+]]) + // CHECK: ![[NUM]] = {{!{null, ![^,]*, ![^,]*, ![^,]*, null}}} } @end diff --git a/clang/test/CodeGenObjC/debug-property-synth.m b/clang/test/CodeGenObjC/debug-property-synth.m index 1465724..37ff11f 100644 --- a/clang/test/CodeGenObjC/debug-property-synth.m +++ b/clang/test/CodeGenObjC/debug-property-synth.m @@ -18,8 +18,8 @@ // CHECK-NOT: ret // CHECK: load {{.*}}, !dbg ![[DBG2:[0-9]+]] // -// CHECK: [ DW_TAG_subprogram ] [line [[@LINE+4]]] [local] [def] [-[I p1]] -// CHECK: [ DW_TAG_subprogram ] [line [[@LINE+3]]] [local] [def] [-[I setP1:]] +// CHECK: !MDSubprogram(name: "-[I p1]",{{.*}} line: [[@LINE+4]],{{.*}} isLocal: true, isDefinition: true +// CHECK: !MDSubprogram(name: "-[I setP1:]",{{.*}} line: [[@LINE+3]],{{.*}} isLocal: true, isDefinition: true // CHECK: ![[DBG1]] = !MDLocation(line: [[@LINE+2]], // CHECK: ![[DBG2]] = !MDLocation(line: [[@LINE+1]], @property int p1; diff --git a/clang/test/CodeGenObjC/debuginfo-properties.m b/clang/test/CodeGenObjC/debuginfo-properties.m index 9a35714..707d234 100644 --- a/clang/test/CodeGenObjC/debuginfo-properties.m +++ b/clang/test/CodeGenObjC/debuginfo-properties.m @@ -11,10 +11,19 @@ @protocol HasASelection @property (nonatomic, retain) Selection* selection; -// CHECK: [ DW_TAG_subprogram ] [line [[@LINE-1]]] [local] [def] [-[MyClass selection]] -// CHECK: [ DW_TAG_subprogram ] [line [[@LINE-2]]] [local] [def] [-[MyClass setSelection:]] -// CHECK: [ DW_TAG_subprogram ] [line [[@LINE-3]]] [local] [def] [-[OtherClass selection]] -// CHECK: [ DW_TAG_subprogram ] [line [[@LINE-4]]] [local] [def] [-[OtherClass setSelection:]] +// CHECK: !MDSubprogram(name: "-[MyClass selection]" +// CHECK-SAME: line: [[@LINE-2]] +// CHECK-SAME: isLocal: true, isDefinition: true +// CHECK: !MDSubprogram(name: "-[MyClass setSelection:]" +// CHECK-SAME: line: [[@LINE-5]] +// CHECK-SAME: isLocal: true, isDefinition: true +// CHECK: !MDSubprogram(name: "-[OtherClass selection]" +// CHECK-SAME: line: [[@LINE-8]] +// CHECK-SAME: isLocal: true, isDefinition: true +// CHECK: !MDSubprogram(name: "-[OtherClass setSelection:]" +// CHECK-SAME: line: [[@LINE-11]] +// CHECK-SAME: isLocal: true, isDefinition: true + @end @interface MyClass : NSObject { diff --git a/clang/test/CodeGenObjC/objc-fixed-enum.m b/clang/test/CodeGenObjC/objc-fixed-enum.m index eff317c..dbac91d 100644 --- a/clang/test/CodeGenObjC/objc-fixed-enum.m +++ b/clang/test/CodeGenObjC/objc-fixed-enum.m @@ -46,19 +46,35 @@ int main() { // -treated as C++11 strongly typed enums. return e0 != e1 && e1 == e2 && e2 == e3; } -// CHECK: ![[ENUMERATOR0:[0-9]+]] = {{.*}}; [ DW_TAG_enumeration_type ] [line 10 -// CHECK: ![[ENUMERATOR1:[0-9]+]] = {{.*}}; [ DW_TAG_enumeration_type ] [Enum1] [line 16{{.*}}] [from NSInteger] -// CHECK: ![[ENUMERATOR3:[0-9]+]] = {{.*}}; [ DW_TAG_typedef ] [NSInteger] [line 6{{.*}}] [from long int] -// CHECK: ![[ENUMERATOR2:[0-9]+]] = {{.*}}; [ DW_TAG_enumeration_type ] [line 22{{.*}}] [from NSInteger] +// CHECK: ![[ENUMERATOR0:[0-9]+]] = !MDCompositeType(tag: DW_TAG_enumeration_type +// CHECK-SAME: line: 10, +// CHECK: ![[ENUMERATOR1:[0-9]+]] = !MDCompositeType(tag: DW_TAG_enumeration_type, name: "Enum1" +// CHECK-SAME: line: 16 +// CHECK-SAME: baseType: ![[ENUMERATOR3:[0-9]+]] +// CHECK: ![[ENUMERATOR3]] = !MDDerivedType(tag: DW_TAG_typedef, name: "NSInteger" +// CHECK-SAME: line: 6 +// CHECK-SAME: baseType: ![[LONGINT:[0-9]+]] +// CHECK: ![[LONGINT]] = !MDBasicType(name: "long int" +// CHECK: ![[ENUMERATOR2:[0-9]+]] = !MDCompositeType(tag: DW_TAG_enumeration_type, +// CHECK-SAME: line: 22 +// CHECK-SAME: baseType: ![[ENUMERATOR3]] -// CHECK: ![[ENUM0]] = !{!"0x100\00e0\00{{[^,]*}}"{{, [^,]+, [^,]+}}, ![[TYPE0:[0-9]+]]} ; [ DW_TAG_auto_variable ] -// CHECK: ![[TYPE0]] = !{!"0x16\00Enum0\00{{.*}}", {{.*}}, ![[ENUMERATOR0]]} ; [ DW_TAG_typedef ] [Enum0] +// CHECK: ![[ENUM0]] = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "e0" +// CHECK-SAME: type: ![[TYPE0:[0-9]+]] +// CHECK: ![[TYPE0]] = !MDDerivedType(tag: DW_TAG_typedef, name: "Enum0", +// CHECK-SAME: baseType: ![[ENUMERATOR0]] -// CHECK: ![[ENUM1]] = !{!"0x100\00e1\00{{[^,]*}}"{{, [^,]+, [^,]+}}, ![[TYPE1:[0-9]+]]} ; [ DW_TAG_auto_variable ] -// CHECK: ![[TYPE1]] = !{!"0x16\00Enum1\00{{.*}}", {{.*}}, ![[ENUMERATOR1]]} ; [ DW_TAG_typedef ] [Enum1] +// CHECK: ![[ENUM1]] = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "e1" +// CHECK-SAME: type: ![[TYPE1:[0-9]+]] +// CHECK: ![[TYPE1]] = !MDDerivedType(tag: DW_TAG_typedef, name: "Enum1" +// CHECK-SAME: baseType: ![[ENUMERATOR1]] -// CHECK: ![[ENUM2]] = !{!"0x100\00e2\00{{[^,]*}}"{{, [^,]+, [^,]+}}, ![[TYPE2:[0-9]+]]} ; [ DW_TAG_auto_variable ] -// CHECK: ![[TYPE2]] = !{!"0x16\00Enum2\00{{.*}}", {{.*}}, ![[ENUMERATOR2]]} ; [ DW_TAG_typedef ] [Enum2] +// CHECK: ![[ENUM2]] = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "e2" +// CHECK-SAME: type: ![[TYPE2:[0-9]+]] +// CHECK: ![[TYPE2]] = !MDDerivedType(tag: DW_TAG_typedef, name: "Enum2" +// CHECK-SAME: baseType: ![[ENUMERATOR2]] -// CHECK: ![[ENUM3]] = !{!"0x100\00e3\00{{[^,]*}}"{{, [^,]+, [^,]+}}, ![[TYPE3:[0-9]+]]} ; [ DW_TAG_auto_variable ] -// CHECK: ![[TYPE3]] = !{!"0x16\00Enum3\00{{.*}}", {{.*}}, ![[ENUMERATOR3]]} ; [ DW_TAG_typedef ] [Enum3] +// CHECK: ![[ENUM3]] = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "e3" +// CHECK-SAME: type: ![[TYPE3:[0-9]+]] +// CHECK: ![[TYPE3]] = !MDDerivedType(tag: DW_TAG_typedef, name: "Enum3" +// CHECK-SAME: baseType: ![[ENUMERATOR3]] diff --git a/clang/test/CodeGenObjCXX/debug-info-cyclic.mm b/clang/test/CodeGenObjCXX/debug-info-cyclic.mm index 8fd83a5..fdae22b 100644 --- a/clang/test/CodeGenObjCXX/debug-info-cyclic.mm +++ b/clang/test/CodeGenObjCXX/debug-info-cyclic.mm @@ -1,13 +1,21 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin -g -emit-llvm %s -o - | FileCheck %s -// CHECK: ![[B:.*]] = {{.*}}, null, null, ![[BMEMBERS:.*]], null, null, null} ; [ DW_TAG_structure_type ] [B] [line [[@LINE+1]], size 8, align 8, offset 0] [def] [from ] struct B { +// CHECK: ![[B:[0-9]+]] = !MDCompositeType(tag: DW_TAG_structure_type, name: "B" +// CHECK-SAME: line: [[@LINE-2]], +// CHECK-SAME: size: 8, align: 8, +// CHECK-NOT: offset: +// CHECK-NOT: DIFlagFwdDecl +// CHECK-SAME: elements: ![[BMEMBERS:[0-9]+]] +// CHECK: ![[BMEMBERS]] = !{![[BB:[0-9]+]]} B(struct A *); -// CHECK: ![[BMEMBERS]] = !{![[BB:.*]]} -// CHECK: ![[BB]] = {{.*}} ![[B]], ![[TY:[0-9]+]], {{.*}}} ; [ DW_TAG_subprogram ] [line [[@LINE-2]]] [B] -// CHECK: ![[TY]] = {{.*}} ![[ARGS:[0-9]+]], null, null, null} ; [ DW_TAG_subroutine_type ] -// CHECK: ![[ARGS]] = !{null, ![[THIS:[0-9]+]], -// CHECK: ![[THIS]] = {{.*}}[[B]]} ; [ DW_TAG_pointer_type ] [ +// CHECK: ![[BB]] = !MDSubprogram(name: "B", scope: ![[B]] +// CHECK-SAME: line: [[@LINE-2]], +// CHECK-SAME: type: ![[TY:[0-9]+]], +// CHECK: ![[TY]] = !MDSubroutineType(types: ![[ARGS:[0-9]+]]) +// CHECK: ![[ARGS]] = !{null, ![[THIS:[0-9]+]], !{{[^,]+}}} +// CHECK: ![[THIS]] = !MDDerivedType(tag: DW_TAG_pointer_type, +// CHECK-SAME: baseType: ![[B]] }; struct C { diff --git a/clang/test/Driver/darwin-debug-flags.c b/clang/test/Driver/darwin-debug-flags.c index abe3f69..0f3ce79 100644 --- a/clang/test/Driver/darwin-debug-flags.c +++ b/clang/test/Driver/darwin-debug-flags.c @@ -5,11 +5,11 @@ // // RUN: %clang -### -target i386-apple-darwin9 -c -g %t.s 2>&1 | FileCheck -check-prefix=P %s -// CHECK: !0 = !{ -// CHECK: -I path\5C with\5C \5C\5Cspaces -// CHECK: -g -Os -// CHECK: -mmacosx-version-min=10.5.0 -// CHECK: [ DW_TAG_compile_unit ] +// CHECK: !0 = !MDCompileUnit( +// CHECK-SAME: flags: +// CHECK-SAME: -I path\5C with\5C \5C\5Cspaces +// CHECK-SAME: -g -Os +// CHECK-SAME: -mmacosx-version-min=10.5.0 int x; diff --git a/clang/test/PCH/debug-info-limited-struct.c b/clang/test/PCH/debug-info-limited-struct.c index 9d0ed26..65f1d12 100644 --- a/clang/test/PCH/debug-info-limited-struct.c +++ b/clang/test/PCH/debug-info-limited-struct.c @@ -1,4 +1,6 @@ // RUN: %clang_cc1 -emit-pch -o %t %S/debug-info-limited-struct.h // RUN: %clang_cc1 -include-pch %t -emit-llvm %s -g -o - | FileCheck %s -// CHECK-DAG: [ DW_TAG_structure_type ] [foo] {{.*}} [def] +// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "foo" +// CHECK-NOT: flags: {{[^,]*}}FlagFwdDecl +// CHECK-SAME: {{$}} diff --git a/clang/test/VFS/external-names.c b/clang/test/VFS/external-names.c index 81ec4ec..a800f1c 100644 --- a/clang/test/VFS/external-names.c +++ b/clang/test/VFS/external-names.c @@ -28,8 +28,8 @@ // Debug info // RUN: %clang_cc1 -I %t -ivfsoverlay %t.external.yaml -triple %itanium_abi_triple -g -emit-llvm %s -o - | FileCheck -check-prefix=CHECK-DEBUG-EXTERNAL %s -// CHECK-DEBUG-EXTERNAL: ![[Num:[0-9]*]] = !{!"{{.*}}Inputs{{.}}external-names.h -// CHECK-DEBUG-EXTERNAL: !{!"0x29", ![[Num]]{{.*}}DW_TAG_file_type +// CHECK-DEBUG-EXTERNAL: !MDSubprogram({{.*}}file: ![[Num:[0-9]+]] +// CHECK-DEBUG-EXTERNAL: ![[Num]] = !MDFile(filename: "{{[^"]*}}Inputs{{.}}external-names.h" // RUN: %clang_cc1 -I %t -ivfsoverlay %t.yaml -triple %itanium_abi_triple -g -emit-llvm %s -o - | FileCheck -check-prefix=CHECK-DEBUG %s // CHECK-DEBUG-NOT: Inputs -- 2.7.4