blob: 01fbe58bdd31bbd3fc139e31e876190108b52020 [file] [log] [blame]
Adrian Prantl5ae17a12013-06-07 01:10:45 +00001// RUN: %clang_cc1 -emit-llvm -x objective-c -g -triple x86_64-apple-macosx10.8.0 %s -o - | FileCheck %s
2//
3// rdar://problem/14035789
4//
5// Ensure we emit the names of explicit/renamed accessors even if they
6// are defined later in the implementation section.
7//
Pirama Arumuga Nainar3ea9e332015-04-08 08:57:32 -07008// CHECK: !MDObjCProperty(name: "blah"
9// CHECK-SAME: getter: "isBlah"
Adrian Prantl5ae17a12013-06-07 01:10:45 +000010
11@class NSString;
12extern void NSLog(NSString *format, ...);
13typedef signed char BOOL;
14
15#define YES ((BOOL)1)
16#define NO ((BOOL)0)
17
18typedef unsigned int NSUInteger;
19
20@protocol NSObject
21@end
22
23@interface NSObject <NSObject>
24- (id)init;
25+ (id)alloc;
26@end
27
28@interface Bar : NSObject
29@property int normal_property;
30@property (getter=isBlah, setter=setBlah:) BOOL blah;
31@end
32
33@implementation Bar
34@synthesize normal_property;
35
36- (BOOL) isBlah
37{
38 return YES;
39}
40- (void) setBlah: (BOOL) newBlah
41{
42 NSLog (@"Speak up, I didn't catch that.");
43}
44@end
45
46int
47main ()
48{
49 Bar *my_bar = [[Bar alloc] init];
50
51 if (my_bar.blah)
52 NSLog (@"It was true!!!");
53
54 my_bar.blah = NO;
55
56 return 0;
57}