Skip to content

Commit f04be1f

Browse files
committed
DebugInfo: Move new hierarchy into place (clang)
Update testcases for LLVM change in r231082 to use the new debug info hierarchy. llvm-svn: 231083
1 parent e274180 commit f04be1f

File tree

118 files changed

+1108
-568
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+1108
-568
lines changed

clang/test/CodeGen/2005-12-04-DeclarationLineNumbers.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
// RUN: %clang_cc1 %s -emit-llvm -g -o - | grep DW_TAG_compile_unit | count 1
1+
// RUN: %clang_cc1 %s -emit-llvm -g -o - | FileCheck %s
2+
// CHECK: !MDCompileUnit(
3+
// CHECK-NOT: !MDCompileUnit(
24
// PR664: ensure that line #'s are emitted for declarations
35

4-
56
short test(short br_data_0,
67
short br_data_1,
78
short br_data_2,

clang/test/CodeGen/2009-10-20-GlobalDebug.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,11 @@ int main() {
66
return 0;
77
}
88

9-
// CHECK: !"0x34\00localstatic\00localstatic\00\005\001\001", !{{.*}}, !{{.*}}, !{{.*}}, i32* @main.localstatic, null} ; [ DW_TAG_variable ]
10-
// CHECK: !"0x34\00global\00global\00\003\000\001", null, !{{.*}}, !{{.*}}, i32* @global, null} ; [ DW_TAG_variable ]
9+
// CHECK: !MDGlobalVariable(name: "localstatic"
10+
// CHECK-NOT: linkageName:
11+
// CHECK-SAME: line: 5,
12+
// CHECK-SAME: variable: i32* @main.localstatic
13+
// CHECK: !MDGlobalVariable(name: "global"
14+
// CHECK-NOT: linkageName:
15+
// CHECK-SAME: line: 3,
16+
// CHECK-SAME: variable: i32* @global

clang/test/CodeGen/2010-02-15-DbgStaticVar.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ int main() {
1111
int j = foo(1);
1212
return 0;
1313
}
14-
// CHECK: !"0x34\00b\00b\00\00{{.*}}",
14+
// CHECK: !MDGlobalVariable(name: "b",
15+
// CHECK-NOT: linkageName:
16+
// CHECK-SAME: ){{$}}

clang/test/CodeGen/2010-02-16-DbgScopes.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// RUN: %clang_cc1 -emit-llvm -g < %s | FileCheck %s
22
// Test to check number of lexical scope identified in debug info.
3-
// CHECK: DW_TAG_lexical_block
4-
// CHECK: DW_TAG_lexical_block
5-
// CHECK: DW_TAG_lexical_block
6-
// CHECK: DW_TAG_lexical_block
3+
// CHECK: !MDLexicalBlock(
4+
// CHECK: !MDLexicalBlock(
5+
// CHECK: !MDLexicalBlock(
6+
// CHECK: !MDLexicalBlock(
77

88
extern int bar();
99
extern void foobar();
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
// RUN: %clang -emit-llvm -S -O0 -g %s -o - | grep DW_TAG_variable
1+
// RUN: %clang -emit-llvm -S -O0 -g %s -o - | FileCheck %s
2+
// CHECK: !MDGlobalVariable(
23
unsigned char ctable1[1] = { 0001 };

clang/test/CodeGen/2010-03-5-LexicalScope.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %clang_cc1 -emit-llvm -g %s -o - | FileCheck %s
2-
// CHECK: DW_TAG_lexical_block
3-
// CHECK: DW_TAG_lexical_block
2+
// CHECK: !MDLexicalBlock(
3+
// CHECK: !MDLexicalBlock(
44
int foo(int i) {
55
if (i) {
66
int j = 2;

clang/test/CodeGen/2010-08-10-DbgConstant.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// RUN: %clang_cc1 -S -emit-llvm -g %s -o - | grep DW_TAG_variable
1+
// RUN: %clang_cc1 -S -emit-llvm -g %s -o - | FileCheck %s
2+
// CHECK: !MDGlobalVariable(
23

34
static const unsigned int ro = 201;
45
void bar(int);

clang/test/CodeGen/debug-info-args.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
int somefunc(char *x, int y, double z) {
44

5-
// CHECK: ![[NUM:[^,]*]], null, null, null} ; [ DW_TAG_subroutine_type
5+
// CHECK: !MDSubroutineType(types: ![[NUM:[0-9]+]])
66
// CHECK: ![[NUM]] = {{!{![^,]*, ![^,]*, ![^,]*, ![^,]*}}}
77

88
return y;

clang/test/CodeGen/debug-info-block-out-return.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
// out of order or not at all (the latter would occur if they were both assigned
1212
// the same argument number by mistake).
1313

14-
// CHECK: !"0x101\00.block_descriptor\0016777218\00{{[0-9]+}}", {{.*}} ; [ DW_TAG_arg_variable ] [.block_descriptor]
15-
// CHECK: !"0x101\00param\0033554434\00{{[0-9]+}}", {{.*}} ; [ DW_TAG_arg_variable ] [param]
14+
// CHECK: !MDLocalVariable(tag: DW_TAG_arg_variable, name: ".block_descriptor", arg: 1,{{.*}}line: 2,
15+
// CHECK: !MDLocalVariable(tag: DW_TAG_arg_variable, name: "param", arg: 2,{{.*}}line: 2,
1616

1717
// Line directive so we don't have to worry about how many lines preceed the
1818
// test code (as the line number is mangled in with the argument number as shown

clang/test/CodeGen/debug-info-block.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Verify that the desired debugging type is generated for a structure
33
// member that is a pointer to a block.
44

5-
// CHECK: __block_literal_generic{{.*}}DW_TAG_structure_type
6-
// CHECK: __block_descriptor{{.*}}DW_TAG_structure_type
5+
// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "__block_literal_generic"
6+
// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "__block_descriptor"
77
struct inStruct {
88
void (^genericBlockPtr)();
99
} is;

clang/test/CodeGen/debug-info-enum.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
// RUN: %clang_cc1 -emit-llvm -g %s -o - | FileCheck %s
22

3-
// CHECK: [[TEST3_ENUMS:![0-9]*]], null, null, null} ; [ DW_TAG_enumeration_type ] [e]
3+
// CHECK: !MDCompositeType(tag: DW_TAG_enumeration_type, name: "e"
4+
// CHECK-SAME: elements: [[TEST3_ENUMS:![0-9]*]]
45
// CHECK: [[TEST3_ENUMS]] = !{[[TEST3_E:![0-9]*]]}
5-
// CHECK: [[TEST3_E]] = !{!"0x28\00E\00-1"} ; [ DW_TAG_enumerator ] [E :: -1]
6+
// CHECK: [[TEST3_E]] = !MDEnumerator(name: "E", value: -1)
67

78
enum e;
89
void func(enum e *p) {

clang/test/CodeGen/debug-info-file-change.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ int foo() {
1414
return i + j;
1515
}
1616

17-
// CHECK: DW_TAG_lexical_block
18-
// CHECK: !"m.h"
19-
// CHECK: DW_TAG_lexical_block
20-
// CHECK: !"m.c"
21-
// CHECK-NOT: DW_TAG_lexical_block
17+
// CHECK-NOT: !MDLexicalBlock
18+
// CHECK: !MDLexicalBlockFile({{.*}}file: ![[MH:[0-9]+]]
19+
// CHECK: !MDFile(filename: "m.h"
20+
// CHECK: !MDLexicalBlockFile({{.*}}file: ![[MC:[0-9]+]]
21+
// CHECK: !MDFile(filename: "m.c"
22+
// CHECK-NOT: !MDLexicalBlock

clang/test/CodeGen/debug-info-gline-tables-only2.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ int main() {
88
}
99

1010
// CHECK: !llvm.dbg.cu = !{!0}
11-
// CHECK: DW_TAG_compile_unit
12-
// CHECK: {{.*main.* DW_TAG_subprogram}}
13-
// CHECK: DW_TAG_file_type
11+
// CHECK: !MDCompileUnit(
12+
// CHECK: !MDSubprogram(
13+
// CHECK: !MDFile(

clang/test/CodeGen/debug-info-limited.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
// Ensure we emit the full definition of 'foo' even though only its declaration
44
// is needed, since C has no ODR to ensure that the definition will be the same
55
// in whatever TU actually uses/requires the definition of 'foo'.
6-
// CHECK: ; [ DW_TAG_structure_type ] [foo] {{.*}} [def]
6+
// CHECK: !MDCompositeType(tag: DW_TAG_structure_type, name: "foo",
7+
// CHECK-NOT: DIFlagFwdDecl
8+
// CHECK-SAME: ){{$}}
79

810
struct foo {
911
};

clang/test/CodeGen/debug-info-same-line.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
// Here two temporary nodes are identical (but should not get uniqued) while
33
// building the full debug type.
44
typedef struct { long x; } foo; typedef struct { foo *x; } bar;
5-
// CHECK: [ DW_TAG_structure_type ] [line 4, size 64,
6-
// CHECK: [ DW_TAG_structure_type ] [line 4, size 64,
5+
// CHECK: !MDCompositeType(tag: DW_TAG_structure_type,{{.*}} line: 4, size: 64,
6+
// CHECK: !MDCompositeType(tag: DW_TAG_structure_type,{{.*}} line: 4, size: 64,
77
bar b;

clang/test/CodeGen/debug-info-scope-file.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
// CHECK: ret void, !dbg [[F1_LINE:![0-9]*]]
77
// CHECK: ret void, !dbg [[F2_LINE:![0-9]*]]
8-
// CHECK: [[F1:![0-9]*]] = {{.*}} ; [ DW_TAG_subprogram ] {{.*}} [def] [f1]
9-
// CHECK: [[F2:![0-9]*]] = {{.*}} ; [ DW_TAG_subprogram ] {{.*}} [def] [f2]
8+
// CHECK: [[F1:![0-9]*]] = !MDSubprogram(name: "f1",{{.*}} isDefinition: true
9+
// CHECK: [[F2:![0-9]*]] = !MDSubprogram(name: "f2",{{.*}} isDefinition: true
1010
// CHECK: [[F1_LINE]] = !MDLocation({{.*}}, scope: [[F1]])
1111
// CHECK: [[F2_LINE]] = !MDLocation({{.*}}, scope: [[F2]])
1212

clang/test/CodeGen/debug-info-scope.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@
55
int main() {
66
int j = 0;
77
int k = 0;
8-
// CHECK: DW_TAG_auto_variable ] [i]
9-
// CHECK-NEXT: DW_TAG_lexical_block
8+
// CHECK: !MDLocalVariable(tag: DW_TAG_auto_variable, name: "i"
9+
// CHECK-NEXT: !MDLexicalBlock(
1010

1111
// FIXME: Looks like we don't actually need both these lexical blocks (disc 2
1212
// just refers to disc 1, nothing actually uses disc 2).
13-
// GMLT-NOT: DW_TAG_lexical_block
14-
// GMLT: "0xb\002", {{.*}}} ; [ DW_TAG_lexical_block ]
15-
// GMLT-NOT: DW_TAG_lexical_block
16-
// GMLT: "0xb\001", {{.*}}} ; [ DW_TAG_lexical_block ]
13+
// GMLT-NOT: !MDLexicalBlock
14+
// GMLT: !MDLexicalBlockFile({{.*}}, discriminator: 2)
15+
// GMLT-NOT: !MDLexicalBlock
16+
// GMLT: !MDLexicalBlockFile({{.*}}, discriminator: 1)
1717
// Make sure we don't have any more lexical blocks because we don't need them in
1818
// -gmlt.
19-
// GMLT-NOT: DW_TAG_lexical_block
19+
// GMLT-NOT: !MDLexicalBlock
2020
for (int i = 0; i < 10; i++)
2121
j++;
22-
// CHECK: DW_TAG_auto_variable ] [i]
23-
// CHECK-NEXT: DW_TAG_lexical_block
24-
// GMLT-NOT: DW_TAG_lexical_block
22+
// CHECK: !MDLocalVariable(tag: DW_TAG_auto_variable, name: "i"
23+
// CHECK-NEXT: !MDLexicalBlock(
24+
// GMLT-NOT: !MDLexicalBlock
2525
for (int i = 0; i < 10; i++)
2626
k++;
2727
return 0;

clang/test/CodeGen/debug-info-static.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %clang_cc1 -g -emit-llvm -o - %s | FileCheck %s
22

3-
// CHECK: xyzzy, null} ; [ DW_TAG_variable ]
3+
// CHECK: !MDGlobalVariable({{.*}}variable: i32* @f.xyzzy
44
void f(void)
55
{
66
static int xyzzy;

clang/test/CodeGen/debug-info-typedef.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ typedef int MyType;
77

88
MyType a;
99

10-
// CHECK: !"0x16\00MyType\002\00{{.*}}", ![[HEADER:[0-9]+]], null{{.*}}} ; [ DW_TAG_typedef ] [MyType] [line 2, size 0, align 0, offset 0] [from int]
11-
// CHECK: ![[HEADER]] = !{!"b.h",
10+
// CHECK: !MDDerivedType(tag: DW_TAG_typedef, name: "MyType", file: ![[HEADER:[0-9]+]], line: 2,
11+
// CHECK: ![[HEADER]] = !MDFile(filename: "b.h",

clang/test/CodeGen/debug-info-vector.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,8 @@ typedef int v4si __attribute__((__vector_size__(16)));
44
v4si a;
55

66
// Test that we get an array type that's also a vector out of debug.
7-
// CHECK: [ DW_TAG_array_type ] [line 0, size 128, align 128, offset 0] [vector] [from int]
7+
// CHECK: !MDCompositeType(tag: DW_TAG_array_type,
8+
// CHECK-SAME: baseType: ![[INT:[0-9]+]]
9+
// CHECK-SAME: size: 128, align: 128
10+
// CHECK-SAME: DIFlagVector
11+
// CHECK: ![[INT]] = !MDBasicType(name: "int"

clang/test/CodeGen/debug-info-version.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ int main (void) {
44
return 0;
55
}
66

7-
// CHECK: i32 2, !"Debug Info Version", i32 2}
7+
// CHECK: i32 2, !"Debug Info Version", i32 3}
88
// NO_DEBUG-NOT: !"Debug Info Version"

clang/test/CodeGen/debug-info-vla.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ void testVLAwithSize(int s)
44
{
55
// CHECK: dbg.declare
66
// CHECK: dbg.declare({{.*}}, metadata ![[VAR:.*]], metadata ![[EXPR:.*]])
7-
// CHECK: ![[VAR]] = {{.*}} ; [ DW_TAG_auto_variable ] [vla] [line [[@LINE+2]]]
8-
// CHECK: ![[EXPR]] = {{.*}} ; [ DW_TAG_expression ] [DW_OP_deref]
7+
// CHECK: ![[VAR]] = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "vla",{{.*}} line: [[@LINE+2]]
8+
// CHECK: ![[EXPR]] = !MDExpression(DW_OP_deref)
99
int vla[s];
1010
int i;
1111
for (i = 0; i < s; i++) {

clang/test/CodeGen/debug-info.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ struct foo2 foo2;
4242

4343

4444
// Radar 7325611
45-
// CHECK: !"0x16\00barfoo\00{{.*}}"
45+
// CHECK: !MDDerivedType(tag: DW_TAG_typedef, name: "barfoo"
4646
typedef int barfoo;
4747
barfoo foo() {
4848
}

clang/test/CodeGen/lineno-dbginfo.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
// RUN: echo "#include <stddef.h>" > %t.h
22
// RUN: %clang_cc1 -S -g -include %t.h %s -emit-llvm -o - | FileCheck %s
33

4-
// CHECK: !"0x34\00outer\00outer\00\00[[@LINE+1]]\000\001"
4+
// CHECK: !MDGlobalVariable(name: "outer",
5+
// CHECK-NOT: linkageName:
6+
// CHECK-SAME: line: [[@LINE+2]]
7+
// CHECK-SAME: isDefinition: true
58
int outer = 42;
69

clang/test/CodeGenCXX/2010-07-23-DeclLoc.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
// RUN: %clang_cc1 -emit-llvm -g %s -o - | FileCheck %s
22
// Require the template function declaration refer to the correct filename.
33
// First, locate the function decl in metadata, and pluck out the file handle:
4-
// CHECK: !"0x2e\00extract_dwarf_data_from_header{{[^"]+}}", [[filehandle:![0-9]+]]
4+
// CHECK: !MDSubprogram(name: "extract_dwarf_data_from_header
5+
// CHECK-SAME: file: [[FILE:![0-9]+]]
56
// Second: Require that filehandle refer to the correct filename:
6-
// CHECK: [[filehandle]] = {{.*}}decl_should_be_here.hpp"
7+
// CHECK: [[FILE]] = !MDFile(filename: "decl_should_be_here.hpp"
78
typedef long unsigned int __darwin_size_t;
89
typedef __darwin_size_t size_t;
910
typedef unsigned char uint8_t;

clang/test/CodeGenCXX/Inputs/debug-info-class-limited.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
// CHECK-DAG: [ DW_TAG_structure_type ] [PR16214] [line [[@LINE+1]], {{.*}} [def]
2+
// CHECK-DAG: !MDCompositeType(tag: DW_TAG_structure_type, name: "PR16214",{{.*}} line: [[@LINE+1]],{{.*}} isDefinition: true
33
struct PR16214 {
44
int i;
55
};
@@ -10,7 +10,7 @@ bar *a;
1010
bar b;
1111

1212
namespace PR14467 {
13-
// CHECK-DAG: [ DW_TAG_structure_type ] [foo] [line [[@LINE+1]], {{.*}} [def]
13+
// CHECK-DAG: !MDCompositeType(tag: DW_TAG_structure_type, name: "foo",{{.*}} line: [[@LINE+1]],{{.*}} isDefinition: true
1414
struct foo {
1515
};
1616

@@ -21,7 +21,7 @@ foo *bar(foo *a) {
2121
}
2222

2323
namespace test1 {
24-
// CHECK-DAG: [ DW_TAG_structure_type ] [foo] [line [[@LINE+1]], {{.*}} [def]
24+
// CHECK-DAG: !MDCompositeType(tag: DW_TAG_structure_type, name: "foo",{{.*}} line: [[@LINE+1]],{{.*}} isDefinition: true
2525
struct foo {
2626
};
2727

@@ -35,7 +35,7 @@ namespace test2 {
3535
// FIXME: if we were a bit fancier, we could realize that the 'foo' type is only
3636
// required because of the 'bar' type which is not required at all (or might
3737
// only be required to be declared)
38-
// CHECK-DAG: [ DW_TAG_structure_type ] [foo] [line [[@LINE+1]], {{.*}} [def]
38+
// CHECK-DAG: !MDCompositeType(tag: DW_TAG_structure_type, name: "foo",{{.*}} line: [[@LINE+1]],{{.*}} isDefinition: true
3939
struct foo {
4040
};
4141

clang/test/CodeGenCXX/PR20038.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ struct C {
66
extern bool b;
77
// CHECK: call {{.*}}, !dbg [[DTOR_CALL1_LOC:![0-9]*]]
88
// CHECK: call {{.*}}, !dbg [[DTOR_CALL2_LOC:![0-9]*]]
9-
// CHECK: [[FUN1:.*]] = {{.*}}; [ DW_TAG_subprogram ] {{.*}} [def] [fun1]
10-
// CHECK: [[FUN2:.*]] = {{.*}}; [ DW_TAG_subprogram ] {{.*}} [def] [fun2]
9+
// CHECK: [[FUN1:.*]] = !MDSubprogram(name: "fun1",{{.*}} isDefinition: true
10+
// CHECK: [[FUN2:.*]] = !MDSubprogram(name: "fun2",{{.*}} isDefinition: true
1111
// CHECK: [[DTOR_CALL1_LOC]] = !MDLocation(line: [[@LINE+1]], scope: [[FUN1]])
1212
void fun1() { b && (C(), 1); }
1313
// CHECK: [[DTOR_CALL2_LOC]] = !MDLocation(line: [[@LINE+1]], scope: [[FUN2]])

clang/test/CodeGenCXX/coverage.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@
33
extern "C" void test_name1() {}
44
void test_name2() {}
55

6-
// CHECK: !"0x2e\00test_name1\00test_name1\00\00{{[^,]+}}", {{.*}} DW_TAG_subprogram
7-
// CHECK: !"0x2e\00test_name2\00test_name2\00_Z10test_name2v\00{{[^,]+}}", {{.*}} DW_TAG_subprogram
6+
// CHECK: !MDSubprogram(name: "test_name1",
7+
// CHECK-NOT: linkageName:
8+
// CHECK-SAME: ){{$}}
9+
// CHECK: !MDSubprogram(name: "test_name2", linkageName: "_Z10test_name2v"

clang/test/CodeGenCXX/debug-info-access.cpp

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,39 @@
11
// RUN: %clang_cc1 -emit-llvm -g -triple %itanium_abi_triple %s -o - | FileCheck %s
22
// Test the various accessibility flags in the debug info.
33
struct A {
4-
// CHECK-DAG: [ DW_TAG_subprogram ] [line [[@LINE+1]]] [pub_default]
4+
// CHECK-DAG: !MDSubprogram(name: "pub_default",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagPrototyped,
55
void pub_default();
6-
// CHECK-DAG: [ DW_TAG_member ] [pub_default_static] [line [[@LINE+1]]{{.*}}offset 0] [static]
6+
// CHECK-DAG: !MDDerivedType(tag: DW_TAG_member, name: "pub_default_static",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagStaticMember)
77
static int pub_default_static;
88
};
99

10-
// CHECK: [ DW_TAG_inheritance ] {{.*}} [public] [from {{.*}}A]
10+
// CHECK: !MDDerivedType(tag: DW_TAG_inheritance,{{.*}} baseType: !"_ZTS1A",{{.*}} flags: DIFlagPublic)
1111
class B : public A {
1212
public:
13-
// CHECK-DAG: [ DW_TAG_subprogram ] [line [[@LINE+1]]] [public] [pub]
13+
// CHECK-DAG: !MDSubprogram(name: "pub",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagPublic | DIFlagPrototyped,
1414
void pub();
15-
// CHECK-DAG: [ DW_TAG_member ] [public_static] [line [[@LINE+1]]{{.*}} [public] [static]
15+
// CHECK-DAG: !MDDerivedType(tag: DW_TAG_member, name: "public_static",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagPublic | DIFlagStaticMember)
1616
static int public_static;
1717
protected:
18-
// CHECK: [ DW_TAG_subprogram ] [line [[@LINE+1]]] [protected] [prot]
18+
// CHECK: !MDSubprogram(name: "prot",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagProtected | DIFlagPrototyped,
1919
void prot();
2020
private:
21-
// CHECK: [ DW_TAG_subprogram ] [line [[@LINE+1]]] [priv_default]
21+
// CHECK: !MDSubprogram(name: "priv_default",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagPrototyped,
2222
void priv_default();
2323
};
2424

2525
union U {
26-
// CHECK-DAG: [ DW_TAG_subprogram ] [line [[@LINE+1]]] [union_pub_default]
26+
// CHECK-DAG: !MDSubprogram(name: "union_pub_default",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagPrototyped,
2727
void union_pub_default();
2828
private:
29-
// CHECK-DAG: [ DW_TAG_member ] [union_priv] [line [[@LINE+1]]{{.*}} [private]
29+
// CHECK-DAG: !MDDerivedType(tag: DW_TAG_member, name: "union_priv",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagPrivate)
3030
int union_priv;
3131
};
3232

3333

34-
// CHECK: {{.*}}\00256\00{{.*}} ; [ DW_TAG_subprogram ] [line [[@LINE+1]]] [def] [free]
34+
// CHECK: !MDSubprogram(name: "free",
35+
// CHECK-SAME: isDefinition: true
36+
// CHECK-SAME: flags: DIFlagPrototyped,
3537
void free() {}
3638

3739
A a;

0 commit comments

Comments
 (0)