blob: 4c7b98466a3e59931758b4b398a3331685f2f615 [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//
8// CHECK: metadata !{i32 {{.*}}, metadata !"blah", {{.*}} metadata !"isBlah", metadata !"", {{.*}}} ; [ DW_TAG_APPLE_property ] [blah]
9
10@class NSString;
11extern void NSLog(NSString *format, ...);
12typedef signed char BOOL;
13
14#define YES ((BOOL)1)
15#define NO ((BOOL)0)
16
17typedef unsigned int NSUInteger;
18
19@protocol NSObject
20@end
21
22@interface NSObject <NSObject>
23- (id)init;
24+ (id)alloc;
25@end
26
27@interface Bar : NSObject
28@property int normal_property;
29@property (getter=isBlah, setter=setBlah:) BOOL blah;
30@end
31
32@implementation Bar
33@synthesize normal_property;
34
35- (BOOL) isBlah
36{
37 return YES;
38}
39- (void) setBlah: (BOOL) newBlah
40{
41 NSLog (@"Speak up, I didn't catch that.");
42}
43@end
44
45int
46main ()
47{
48 Bar *my_bar = [[Bar alloc] init];
49
50 if (my_bar.blah)
51 NSLog (@"It was true!!!");
52
53 my_bar.blah = NO;
54
55 return 0;
56}