blob: 0ef350ab2e8ed8f78571d3592e8aa6373645059f [file] [log] [blame]
Adrian Prantl4919de62013-03-06 22:03:30 +00001// 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 Hines6bcf27b2014-05-29 04:14:42 -07006// 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 Nainar3ea9e332015-04-08 08:57:32 -07009// 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 Hines6bcf27b2014-05-29 04:14:42 -070013
Adrian Prantl4919de62013-03-06 22:03:30 +000014@interface I
15{
16 @public int a;
17}
18@end
19
20void foo(I* pi) {
21 int _a = pi->a;
22}
23
24// another layer of indirection
25struct S
26{
27 I* i;
28};
29
30@interface I()
31{
32 @public int b;
33}
34@end
35
36void gorf (struct S* s) {
37 int _b = s->i->b;
38}
39
Stephen Hines6bcf27b2014-05-29 04:14:42 -070040
41I *source();
42
43@interface I()
44{
45 @public int c;
46}
47@end
48
49void use() {
50 int _c = source()->c;
51}
52
53@interface I()
54{
55 @public int d;
56}
57@end
58
59I *x();