brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · 22e5491 Raw
56 lines · plain
1// RUN: %clang_cc1 -emit-llvm -x objective-c -debug-info-kind=limited -triple x86_64-apple-macosx10.8.0 %s -o - | FileCheck %s2//3// Ensure we emit the names of explicit/renamed accessors even if they4// are defined later in the implementation section.5//6// CHECK:  !DIObjCProperty(name: "blah"7// CHECK-SAME:             getter: "isBlah"8 9@class NSString;10extern void NSLog(NSString *format, ...);11typedef signed char BOOL;12 13#define YES             ((BOOL)1)14#define NO              ((BOOL)0)15 16typedef unsigned int NSUInteger;17 18@protocol NSObject19@end20 21@interface NSObject <NSObject>22- (id)init;23+ (id)alloc;24@end25 26@interface Bar : NSObject27@property int normal_property;28@property (getter=isBlah, setter=setBlah:) BOOL blah;29@end30 31@implementation Bar32@synthesize normal_property;33 34- (BOOL) isBlah35{36  return YES;37}38- (void) setBlah: (BOOL) newBlah39{40  NSLog (@"Speak up, I didn't catch that.");41}42@end43 44int45main (void)46{47  Bar *my_bar = [[Bar alloc] init];48 49  if (my_bar.blah)50    NSLog (@"It was true!!!");51 52  my_bar.blah = NO;53 54  return 0;55}56