annotate clang/test/CodeGenCXX/debug-info-decl-nested.cpp @ 206:f17a3b42b08b

Added tag before-12 for changeset b7591485f4cd
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 07 Jun 2021 21:25:57 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -std=c++11 -debug-info-kind=standalone -emit-llvm -triple x86_64-apple-darwin %s -o %t
anatofuz
parents:
diff changeset
2 // RUN: cat %t | FileCheck %s -check-prefix=CHECK0
anatofuz
parents:
diff changeset
3 // RUN: cat %t | FileCheck %s -check-prefix=CHECK1
anatofuz
parents:
diff changeset
4 // RUN: cat %t | FileCheck %s -check-prefix=CHECK2
anatofuz
parents:
diff changeset
5 //
anatofuz
parents:
diff changeset
6 // This test ensures that we associate a declaration with the
anatofuz
parents:
diff changeset
7 // definition of the constructor for OuterClass. The declaration is
anatofuz
parents:
diff changeset
8 // necessary so the backend can emit the DW_AT_specification attribute
anatofuz
parents:
diff changeset
9 // for the definition.
anatofuz
parents:
diff changeset
10 //
anatofuz
parents:
diff changeset
11 // rdar://problem/13116508
anatofuz
parents:
diff changeset
12
anatofuz
parents:
diff changeset
13 class Foo;
anatofuz
parents:
diff changeset
14 class OuterClass
anatofuz
parents:
diff changeset
15 {
anatofuz
parents:
diff changeset
16 static class InnerClass {
anatofuz
parents:
diff changeset
17 public:
anatofuz
parents:
diff changeset
18 InnerClass(); // Here createContextChain() generates a limited type for OuterClass.
anatofuz
parents:
diff changeset
19 } theInnerClass;
anatofuz
parents:
diff changeset
20 // CHECK0: ![[DECL:[0-9]+]] = !DISubprogram(name: "OuterClass"
anatofuz
parents:
diff changeset
21 // CHECK0-SAME: line: [[@LINE+2]]
anatofuz
parents:
diff changeset
22 // CHECK0-SAME: spFlags: 0
anatofuz
parents:
diff changeset
23 OuterClass(const Foo *); // line 10
anatofuz
parents:
diff changeset
24 };
anatofuz
parents:
diff changeset
25 OuterClass::InnerClass OuterClass::theInnerClass; // This toplevel decl causes InnerClass to be generated.
anatofuz
parents:
diff changeset
26 // CHECK0: !DISubprogram(name: "OuterClass"
anatofuz
parents:
diff changeset
27 // CHECK0-SAME: line: [[@LINE+3]]
anatofuz
parents:
diff changeset
28 // CHECK0-SAME: DISPFlagDefinition
anatofuz
parents:
diff changeset
29 // CHECK0-SAME: declaration: ![[DECL]]
anatofuz
parents:
diff changeset
30 OuterClass::OuterClass(const Foo *meta) { } // line 13
anatofuz
parents:
diff changeset
31
anatofuz
parents:
diff changeset
32
anatofuz
parents:
diff changeset
33
anatofuz
parents:
diff changeset
34
anatofuz
parents:
diff changeset
35
anatofuz
parents:
diff changeset
36
anatofuz
parents:
diff changeset
37 class Foo1;
anatofuz
parents:
diff changeset
38 class OuterClass1
anatofuz
parents:
diff changeset
39 {
anatofuz
parents:
diff changeset
40 static class InnerClass1 {
anatofuz
parents:
diff changeset
41 public:
anatofuz
parents:
diff changeset
42 InnerClass1();
anatofuz
parents:
diff changeset
43 } theInnerClass1;
anatofuz
parents:
diff changeset
44 // CHECK1: ![[DECL:[0-9]+]] = !DISubprogram(name: "Bar"
anatofuz
parents:
diff changeset
45 // CHECK1-SAME: line: [[@LINE+2]]
anatofuz
parents:
diff changeset
46 // CHECK1-SAME: spFlags: 0
anatofuz
parents:
diff changeset
47 void Bar(const Foo1 *);
anatofuz
parents:
diff changeset
48 };
anatofuz
parents:
diff changeset
49 OuterClass1::InnerClass1 OuterClass1::theInnerClass1;
anatofuz
parents:
diff changeset
50 // CHECK1: !DISubprogram(name: "Bar"
anatofuz
parents:
diff changeset
51 // CHECK1-SAME: line: [[@LINE+3]]
anatofuz
parents:
diff changeset
52 // CHECK1-SAME: DISPFlagDefinition
anatofuz
parents:
diff changeset
53 // CHECK1-SAME: declaration: ![[DECL]]
anatofuz
parents:
diff changeset
54 void OuterClass1::Bar(const Foo1 *meta) { }
anatofuz
parents:
diff changeset
55
anatofuz
parents:
diff changeset
56
anatofuz
parents:
diff changeset
57
anatofuz
parents:
diff changeset
58
anatofuz
parents:
diff changeset
59
anatofuz
parents:
diff changeset
60 class Foo2;
anatofuz
parents:
diff changeset
61 class OuterClass2
anatofuz
parents:
diff changeset
62 {
anatofuz
parents:
diff changeset
63 static class InnerClass2 {
anatofuz
parents:
diff changeset
64 public:
anatofuz
parents:
diff changeset
65 InnerClass2();
anatofuz
parents:
diff changeset
66 } theInnerClass2;
anatofuz
parents:
diff changeset
67 // CHECK2: ![[DECL:[0-9]+]] = !DISubprogram(name: "~OuterClass2"
anatofuz
parents:
diff changeset
68 // CHECK2-SAME: line: [[@LINE+2]]
anatofuz
parents:
diff changeset
69 // CHECK2-SAME: spFlags: 0
anatofuz
parents:
diff changeset
70 ~OuterClass2(); // line 10
anatofuz
parents:
diff changeset
71 };
anatofuz
parents:
diff changeset
72 OuterClass2::InnerClass2 OuterClass2::theInnerClass2;
anatofuz
parents:
diff changeset
73 // CHECK4: !DISubprogram(name: "~OuterClass2"
anatofuz
parents:
diff changeset
74 // CHECK4-SAME: line: [[@LINE+3]]
anatofuz
parents:
diff changeset
75 // CHECK4-SAME: DISPFlagDefinition
anatofuz
parents:
diff changeset
76 // CHECK4-SAME: declaration: ![[DECL]]
anatofuz
parents:
diff changeset
77 OuterClass2::~OuterClass2() { }