Home | History | Annotate | Download | only in CodeGenObjC
      1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s
      2 
      3 // Make sure we generate debug symbols for ivars added by a class extension.
      4 
      5 @interface I
      6 {
      7     @public int a;
      8 }
      9 @end
     10 
     11 void foo(I* pi) {
     12     // poking into pi for primary class ivars.
     13     int _a = pi->a;
     14 }
     15 
     16 @interface I()
     17 {
     18     @public int b;
     19 }
     20 @end
     21 
     22 void gorf (I* pg) {
     23     // poking into pg for ivars for class extension
     24     int _b = pg->b;
     25 }
     26 
     27 // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "I"
     28 
     29 // Check for "a".
     30 // CHECK: !DIDerivedType(tag: DW_TAG_member, name: "a"
     31 // CHECK-SAME:           line: 7
     32 // CHECK-SAME:           baseType: ![[INT:[0-9]+]]
     33 // CHECK-SAME:           size: 32, align: 32
     34 // CHECK-NOT:            offset:
     35 // CHECK-SAME:           flags: DIFlagPublic
     36 // CHECK: ![[INT]] = !DIBasicType(name: "int"
     37 
     38 // Make sure we don't output the same type twice.
     39 // CHECK-NOT: !DICompositeType(tag: DW_TAG_structure_type, name: "I"
     40 
     41 // Check for "b".
     42 // CHECK: !DIDerivedType(tag: DW_TAG_member, name: "b"
     43 // CHECK-SAME:           line: 18
     44 // CHECK-SAME:           baseType: ![[INT]]
     45 // CHECK-SAME:           size: 32, align: 32
     46 // CHECK-NOT:            offset:
     47 // CHECK-SAME:           flags: DIFlagPublic
     48