blob: 0a337dc05d8c8d2c9bcf79252f0d715db0cd68fb [file] [log] [blame]
David Blaikie9417b052012-11-02 20:49:01 +00001struct foo;
David Blaikie0a0f93c2013-02-01 19:09:49 +00002void func(foo *f) {
David Blaikie9417b052012-11-02 20:49:01 +00003}
4class bar;
David Blaikie0a0f93c2013-02-01 19:09:49 +00005void func(bar *f) {
David Blaikie9417b052012-11-02 20:49:01 +00006}
7union baz;
David Blaikie0a0f93c2013-02-01 19:09:49 +00008void func(baz *f) {
David Blaikie9417b052012-11-02 20:49:01 +00009}
NAKAMURA Takumi95f36362013-02-03 12:52:54 +000010
David Blaikie0a0f93c2013-02-01 19:09:49 +000011class B {
David Blaikiec9a91772012-12-13 22:29:06 +000012public:
13 virtual ~B();
David Blaikiec9a91772012-12-13 22:29:06 +000014};
David Blaikie498298d2013-08-18 16:55:33 +000015
16struct C {
17 virtual void func();
18 struct inner {
19 int j;
20 };
21};
22
David Blaikie0a0f93c2013-02-01 19:09:49 +000023struct A {
Devang Pateldabc3e92010-08-12 00:02:44 +000024 int one;
David Blaikie0a0f93c2013-02-01 19:09:49 +000025 static const int HdrSize = 52;
Devang Pateldabc3e92010-08-12 00:02:44 +000026 int two;
27 A() {
28 int x = 1;
29 }
30};
David Blaikiec9a91772012-12-13 22:29:06 +000031
32
David Blaikie0a0f93c2013-02-01 19:09:49 +000033int main(int argc, char **argv) {
David Blaikie9417b052012-11-02 20:49:01 +000034 B b;
David Blaikie498298d2013-08-18 16:55:33 +000035 C::inner c_i;
David Blaikie0a0f93c2013-02-01 19:09:49 +000036 if (argc) {
37 A a;
38 }
39 return 0;
Devang Pateldabc3e92010-08-12 00:02:44 +000040}
David Blaikie0a0f93c2013-02-01 19:09:49 +000041
NAKAMURA Takumi95f36362013-02-03 12:52:54 +000042// RUN: %clang -target x86_64-unknown_unknown -emit-llvm -g -S %s -o - | FileCheck %s
43// RUN: %clang -target i686-cygwin -emit-llvm -g -S %s -o - | FileCheck %s
44// RUN: %clang -target armv7l-unknown-linux-gnueabihf -emit-llvm -g -S %s -o - | FileCheck %s
45
46// CHECK: invoke {{.+}} @_ZN1BD1Ev(%class.B* %b)
NAKAMURA Takumi288c7552013-02-01 22:53:19 +000047// CHECK-NEXT: unwind label %{{.+}}, !dbg ![[EXCEPTLOC:.*]]
48// CHECK: store i32 0, i32* %{{.+}}, !dbg ![[RETLOC:.*]]
David Blaikie0a0f93c2013-02-01 19:09:49 +000049// CHECK: DW_TAG_structure_type ] [foo]
50// CHECK: DW_TAG_class_type ] [bar]
51// CHECK: DW_TAG_union_type ] [baz]
David Blaikie05a05692013-08-17 00:06:55 +000052// CHECK: DW_TAG_structure_type ] [A]
53// CHECK: HdrSize
David Blaikie0a0f93c2013-02-01 19:09:49 +000054// CHECK: DW_TAG_class_type ] [B]
55// CHECK: metadata !"_vptr$B", {{.*}}, i32 64, metadata !{{.*}}} ; [ DW_TAG_member ]
David Blaikie498298d2013-08-18 16:55:33 +000056// CHECK: metadata [[C_INNER_MEM:![0-9]*]], i32 0, null, null} ; [ DW_TAG_structure_type ] [inner] {{.*}} [def]
57// Context chains (in Clang -flimit-debug-info and in GCC generally) contain
58// definitions without members (& without a vbase 'containing type'):
59// CHECK: null, i32 0, null, null} ; [ DW_TAG_structure_type ] [C] {{.*}} [def]
60// CHECK: [[C_INNER_MEM]] = metadata !{metadata [[C_INNER_I:![0-9]*]]}
61// CHECK: [[C_INNER_I]] = {{.*}} ; [ DW_TAG_member ] [j] {{.*}} [from int]
62// CHECK: ![[EXCEPTLOC]] = metadata !{i32 40,
63// CHECK: ![[RETLOC]] = metadata !{i32 39,