blob: b14c30adec43ac70e950bda499eeb56c21bff391 [file] [log] [blame]
Rafael Espindolaea1ba0a2013-09-27 20:21:48 +00001// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -g %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 Smith3c51fa62014-10-03 20:01:52 +000039// CHECK: metadata !{metadata !"0x101\00bad_carrier\00{{[0-9]+}}\000", metadata !{{[0-9]+}}, null, metadata ![[IDTYPE:[0-9]+]]} ; [ DW_TAG_arg_variable ] [bad_carrier] [line 0]
40//
41// CHECK: metadata !{metadata !"0x101\00good_carrier\00{{[0-9]+}}\000", metadata !{{[0-9]+}}, null, metadata ![[IDTYPE]]} ; [ DW_TAG_arg_variable ] [good_carrier] [line 0]
42// CHECK !{{.*}}[[IDTYPE]] = metadata !{metadata !"0x16\00id\00{{[0-9]+}}\000\000\000\000", null, metadata !{{[0-9]+}}, metadata !{{[0-9]+}}} ; [ DW_TAG_typedef ] [id]