Adrian Prantl | 4919de6 | 2013-03-06 22:03:30 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -g %s -o - | FileCheck %s |
| 2 | |
| 3 | // Make sure we generate debug symbols for an indirectly referenced |
| 4 | // extension to an interface. |
| 5 | |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 6 | // This happens to be the order the members are emitted in... I'm assuming it's |
| 7 | // not meaningful/important, so if something causes the order to change, feel |
| 8 | // free to update the test to reflect the new order. |
Pirama Arumuga Nainar | 3ea9e33 | 2015-04-08 08:57:32 -0700 | [diff] [blame] | 9 | // CHECK: !MDDerivedType(tag: DW_TAG_member, name: "a" |
| 10 | // CHECK: !MDDerivedType(tag: DW_TAG_member, name: "d" |
| 11 | // CHECK: !MDDerivedType(tag: DW_TAG_member, name: "c" |
| 12 | // CHECK: !MDDerivedType(tag: DW_TAG_member, name: "b" |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 13 | |
Adrian Prantl | 4919de6 | 2013-03-06 22:03:30 +0000 | [diff] [blame] | 14 | @interface I |
| 15 | { |
| 16 | @public int a; |
| 17 | } |
| 18 | @end |
| 19 | |
| 20 | void foo(I* pi) { |
| 21 | int _a = pi->a; |
| 22 | } |
| 23 | |
| 24 | // another layer of indirection |
| 25 | struct S |
| 26 | { |
| 27 | I* i; |
| 28 | }; |
| 29 | |
| 30 | @interface I() |
| 31 | { |
| 32 | @public int b; |
| 33 | } |
| 34 | @end |
| 35 | |
| 36 | void gorf (struct S* s) { |
| 37 | int _b = s->i->b; |
| 38 | } |
| 39 | |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 40 | |
| 41 | I *source(); |
| 42 | |
| 43 | @interface I() |
| 44 | { |
| 45 | @public int c; |
| 46 | } |
| 47 | @end |
| 48 | |
| 49 | void use() { |
| 50 | int _c = source()->c; |
| 51 | } |
| 52 | |
| 53 | @interface I() |
| 54 | { |
| 55 | @public int d; |
| 56 | } |
| 57 | @end |
| 58 | |
| 59 | I *x(); |