Home | History | Annotate | Download | only in CodeGenObjC
      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 
      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.
      9 // CHECK: ; [ DW_TAG_member ] [a]
     10 // CHECK: ; [ DW_TAG_member ] [d]
     11 // CHECK: ; [ DW_TAG_member ] [c]
     12 // CHECK: ; [ DW_TAG_member ] [b]
     13 
     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 
     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();
     60