blob: df2492603e360bc182a54ce00a0ed0a7fe263d7e [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 Blaikie0a0f93c2013-02-01 19:09:49 +000015struct A {
Devang Pateldabc3e92010-08-12 00:02:44 +000016 int one;
David Blaikie0a0f93c2013-02-01 19:09:49 +000017 static const int HdrSize = 52;
Devang Pateldabc3e92010-08-12 00:02:44 +000018 int two;
19 A() {
20 int x = 1;
21 }
22};
David Blaikiec9a91772012-12-13 22:29:06 +000023
24
David Blaikie0a0f93c2013-02-01 19:09:49 +000025int main(int argc, char **argv) {
David Blaikie9417b052012-11-02 20:49:01 +000026 B b;
David Blaikie0a0f93c2013-02-01 19:09:49 +000027 if (argc) {
28 A a;
29 }
30 return 0;
Devang Pateldabc3e92010-08-12 00:02:44 +000031}
David Blaikie0a0f93c2013-02-01 19:09:49 +000032
NAKAMURA Takumi95f36362013-02-03 12:52:54 +000033// RUN: %clang -target x86_64-unknown_unknown -emit-llvm -g -S %s -o - | FileCheck %s
34// RUN: %clang -target i686-cygwin -emit-llvm -g -S %s -o - | FileCheck %s
35// RUN: %clang -target armv7l-unknown-linux-gnueabihf -emit-llvm -g -S %s -o - | FileCheck %s
36
37// CHECK: invoke {{.+}} @_ZN1BD1Ev(%class.B* %b)
NAKAMURA Takumi288c7552013-02-01 22:53:19 +000038// CHECK-NEXT: unwind label %{{.+}}, !dbg ![[EXCEPTLOC:.*]]
39// CHECK: store i32 0, i32* %{{.+}}, !dbg ![[RETLOC:.*]]
David Blaikie0a0f93c2013-02-01 19:09:49 +000040// CHECK: DW_TAG_structure_type ] [foo]
41// CHECK: DW_TAG_class_type ] [bar]
42// CHECK: DW_TAG_union_type ] [baz]
43// CHECK: DW_TAG_structure_type ] [A]
44// CHECK: HdrSize
45// CHECK: DW_TAG_class_type ] [B]
46// CHECK: metadata !"_vptr$B", {{.*}}, i32 64, metadata !{{.*}}} ; [ DW_TAG_member ]
47// CHECK: ![[EXCEPTLOC]] = metadata !{i32 31,
48// CHECK: ![[RETLOC]] = metadata !{i32 30,