blob: 8974e27647835604286e9d6560a2d0db04a6115f [file] [log] [blame]
Douglas Katzman3459ce22015-10-08 04:24:12 +00001// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s
Fariborz Jahanian65f1fa12013-02-21 20:42:11 +00002__attribute((objc_root_class)) @interface NSObject {
3 id isa;
4}
5+ (id)alloc;
6- (id)init;
7- (id)retain;
8@end
9
10void 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
29int 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'.
Duncan P. N. Exon Smith9dd4e4e2015-04-29 16:40:08 +000039// CHECK: ![[IDTYPE:[0-9]+]] = !DIDerivedType(tag: DW_TAG_typedef, name: "id"
Duncan P. N. Exon Smith3c51fa62014-10-03 20:01:52 +000040//
Duncan P. N. Exon Smith38a7f112015-07-31 18:59:37 +000041// CHECK: !DILocalVariable(name: "bad_carrier", arg:
Duncan P. N. Exon Smithf04be1f2015-03-03 17:25:55 +000042// CHECK-NOT: line:
43// CHECK-SAME: type: ![[IDTYPE]]
44//
Duncan P. N. Exon Smith38a7f112015-07-31 18:59:37 +000045// CHECK: !DILocalVariable(name: "good_carrier", arg:
Duncan P. N. Exon Smithf04be1f2015-03-03 17:25:55 +000046// CHECK-NOT: line:
47// CHECK-SAME: type: ![[IDTYPE]]