Adrian Prantl | 5ae17a1 | 2013-06-07 01:10:45 +0000 | [diff] [blame] | 1 | // 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; |
| 11 | extern void NSLog(NSString *format, ...); |
| 12 | typedef signed char BOOL; |
| 13 | |
| 14 | #define YES ((BOOL)1) |
| 15 | #define NO ((BOOL)0) |
| 16 | |
| 17 | typedef 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 | |
| 45 | int |
| 46 | main () |
| 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 | } |