Home | History | Annotate | Download | only in CodeGenObjC
      1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-default-synthesize-properties -emit-llvm -g %s -o - | FileCheck %s
      2 __attribute((objc_root_class)) @interface NSObject {
      3 	id isa;
      4 }
      5 + (id)alloc;
      6 - (id)init;
      7 - (id)retain;
      8 @end
      9 
     10 void NSLog(id, ...);
     11 
     12 @protocol MyProtocol
     13 
     14 -(const char *)hello;
     15 
     16 @end
     17 
     18 @interface MyClass : NSObject {
     19 }
     20 
     21 @property (nonatomic, assign) id <MyProtocol> bad_carrier;
     22 @property (nonatomic, assign) id good_carrier;
     23 
     24 @end
     25 
     26 @implementation MyClass
     27 @end
     28 
     29 int main()
     30 {
     31     @autoreleasepool
     32     {
     33         MyClass *my_class = [MyClass alloc];
     34         NSLog(@"%p\n", my_class.bad_carrier);
     35         NSLog(@"%p\n", my_class.good_carrier);
     36     }
     37 }
     38 // Verify that the debug type for both variables is 'id'.
     39 // CHECK: metadata !{i32 {{[0-9]+}}, metadata !{{[0-9]+}}, metadata !"bad_carrier", metadata !{{[0-9]+}}, i32 {{[0-9]+}}, metadata ![[IDTYPE:[0-9]+]], i32 0, i32 0} ; [ DW_TAG_arg_variable ] [bad_carrier] [line 21]
     40 // CHECK: metadata !{i32 {{[0-9]+}}, metadata !{{[0-9]+}}, metadata !"good_carrier", metadata !{{[0-9]+}}, i32 {{[0-9]+}}, metadata !{{.*}}[[IDTYPE]], i32 0, i32 0} ; [ DW_TAG_arg_variable ] [good_carrier] [line 22]
     41 // CHECK !{{.*}}[[IDTYPE]] = metadata !{i32 {{[0-9]+}}, null, metadata !"id", metadata !{{[0-9]+}}, i32 !{{[0-9]+}}, i64 0, i64 0, i64 0, i32 0, metadata !{{[0-9]+}}} ; [ DW_TAG_typedef ] [id]
     42