David Blaikie | 9417b05 | 2012-11-02 20:49:01 +0000 | [diff] [blame] | 1 | struct foo; |
David Blaikie | 0a0f93c | 2013-02-01 19:09:49 +0000 | [diff] [blame] | 2 | void func(foo *f) { |
David Blaikie | 9417b05 | 2012-11-02 20:49:01 +0000 | [diff] [blame] | 3 | } |
| 4 | class bar; |
David Blaikie | 0a0f93c | 2013-02-01 19:09:49 +0000 | [diff] [blame] | 5 | void func(bar *f) { |
David Blaikie | 9417b05 | 2012-11-02 20:49:01 +0000 | [diff] [blame] | 6 | } |
| 7 | union baz; |
David Blaikie | 0a0f93c | 2013-02-01 19:09:49 +0000 | [diff] [blame] | 8 | void func(baz *f) { |
David Blaikie | 9417b05 | 2012-11-02 20:49:01 +0000 | [diff] [blame] | 9 | } |
NAKAMURA Takumi | 95f3636 | 2013-02-03 12:52:54 +0000 | [diff] [blame^] | 10 | |
David Blaikie | 0a0f93c | 2013-02-01 19:09:49 +0000 | [diff] [blame] | 11 | class B { |
David Blaikie | c9a9177 | 2012-12-13 22:29:06 +0000 | [diff] [blame] | 12 | public: |
| 13 | virtual ~B(); |
David Blaikie | c9a9177 | 2012-12-13 22:29:06 +0000 | [diff] [blame] | 14 | }; |
David Blaikie | 0a0f93c | 2013-02-01 19:09:49 +0000 | [diff] [blame] | 15 | struct A { |
Devang Patel | dabc3e9 | 2010-08-12 00:02:44 +0000 | [diff] [blame] | 16 | int one; |
David Blaikie | 0a0f93c | 2013-02-01 19:09:49 +0000 | [diff] [blame] | 17 | static const int HdrSize = 52; |
Devang Patel | dabc3e9 | 2010-08-12 00:02:44 +0000 | [diff] [blame] | 18 | int two; |
| 19 | A() { |
| 20 | int x = 1; |
| 21 | } |
| 22 | }; |
David Blaikie | c9a9177 | 2012-12-13 22:29:06 +0000 | [diff] [blame] | 23 | |
| 24 | |
David Blaikie | 0a0f93c | 2013-02-01 19:09:49 +0000 | [diff] [blame] | 25 | int main(int argc, char **argv) { |
David Blaikie | 9417b05 | 2012-11-02 20:49:01 +0000 | [diff] [blame] | 26 | B b; |
David Blaikie | 0a0f93c | 2013-02-01 19:09:49 +0000 | [diff] [blame] | 27 | if (argc) { |
| 28 | A a; |
| 29 | } |
| 30 | return 0; |
Devang Patel | dabc3e9 | 2010-08-12 00:02:44 +0000 | [diff] [blame] | 31 | } |
David Blaikie | 0a0f93c | 2013-02-01 19:09:49 +0000 | [diff] [blame] | 32 | |
NAKAMURA Takumi | 95f3636 | 2013-02-03 12:52:54 +0000 | [diff] [blame^] | 33 | // 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 Takumi | 288c755 | 2013-02-01 22:53:19 +0000 | [diff] [blame] | 38 | // CHECK-NEXT: unwind label %{{.+}}, !dbg ![[EXCEPTLOC:.*]] |
| 39 | // CHECK: store i32 0, i32* %{{.+}}, !dbg ![[RETLOC:.*]] |
David Blaikie | 0a0f93c | 2013-02-01 19:09:49 +0000 | [diff] [blame] | 40 | // 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, |