xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenObjC/instance-method-metadata.m (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc// REQUIRES: x86-registered-target
2f4a2713aSLionel Sambuc// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -S -o %t %s
3f4a2713aSLionel Sambuc// RUN: FileCheck < %t %s
4f4a2713aSLionel Sambuc
5f4a2713aSLionel Sambuc// rdar://9072317
6f4a2713aSLionel Sambuc
7f4a2713aSLionel Sambuc/** The problem looks like clang getting confused when a single translation unit
8f4a2713aSLionel Sambuc    contains a protocol with a property and two classes that implement that protocol
9f4a2713aSLionel Sambuc    and synthesize the property.
10f4a2713aSLionel Sambuc*/
11f4a2713aSLionel Sambuc
12f4a2713aSLionel Sambuc@protocol Proto
13f4a2713aSLionel Sambuc@property (assign) id prop;
14f4a2713aSLionel Sambuc@end
15f4a2713aSLionel Sambuc
16f4a2713aSLionel Sambuc@interface NSObject @end
17f4a2713aSLionel Sambuc
18f4a2713aSLionel Sambuc@interface Foo : NSObject <Proto> { int x; } @end
19f4a2713aSLionel Sambuc
20f4a2713aSLionel Sambuc@interface Bar : NSObject <Proto> @end
21f4a2713aSLionel Sambuc
22f4a2713aSLionel Sambuc@implementation Foo
23f4a2713aSLionel Sambuc@synthesize prop;
24f4a2713aSLionel Sambuc@end
25f4a2713aSLionel Sambuc
26f4a2713aSLionel Sambuc@implementation Bar
27f4a2713aSLionel Sambuc@synthesize prop;
28f4a2713aSLionel Sambuc@end
29f4a2713aSLionel Sambuc
30f4a2713aSLionel Sambuc// CHECK: l_OBJC_$_INSTANCE_METHODS_Bar:
31f4a2713aSLionel Sambuc// CHECK-NEXT:        .long   24
32f4a2713aSLionel Sambuc// CHECK-NEXT:        .long   2
33f4a2713aSLionel Sambuc// CHECK-NEXT:        .quad   L_OBJC_METH_VAR_NAME_
34f4a2713aSLionel Sambuc// CHECK-NEXT:        .quad   L_OBJC_METH_VAR_TYPE_
35f4a2713aSLionel Sambuc// CHECK-NEXT:        .quad   "-[Bar prop]"
36