brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · 38f69ef Raw
48 lines · plain
1// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s2__attribute((objc_root_class)) @interface NSObject {3	id isa;4}5+ (id)alloc;6- (id)init;7- (id)retain;8@end9 10void NSLog(id, ...);11 12@protocol MyProtocol13 14-(const char *)hello;15 16@end17 18@interface MyClass : NSObject {19}20 21@property (nonatomic, assign) id <MyProtocol> bad_carrier;22@property (nonatomic, assign) id good_carrier;23 24@end25 26@implementation MyClass27@end28 29int main(void)30{31    @autoreleasepool32    {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:  ![[IDTYPE:[0-9]+]] = !DIDerivedType(tag: DW_TAG_typedef, name: "id"40//41// CHECK:  !DILocalVariable(name: "bad_carrier", arg:42// CHECK-NOT:               line:43// CHECK-SAME:              type: ![[IDTYPE]]44//45// CHECK:  !DILocalVariable(name: "good_carrier", arg:46// CHECK-NOT:               line:47// CHECK-SAME:              type: ![[IDTYPE]]48