xref: /llvm-project/clang/test/CodeGenObjC/debug-info-property-accessors.m (revision 0f1c1be1968076d6f96f8a7bcc4a15cf195ecd97)
1// RUN: %clang_cc1 -emit-llvm -x objective-c -debug-info-kind=limited -triple x86_64-apple-macosx10.8.0 %s -o - | FileCheck %s
2//
3// Ensure we emit the names of explicit/renamed accessors even if they
4// 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 NSObject
19@end
20
21@interface NSObject <NSObject>
22- (id)init;
23+ (id)alloc;
24@end
25
26@interface Bar : NSObject
27@property int normal_property;
28@property (getter=isBlah, setter=setBlah:) BOOL blah;
29@end
30
31@implementation Bar
32@synthesize normal_property;
33
34- (BOOL) isBlah
35{
36  return YES;
37}
38- (void) setBlah: (BOOL) newBlah
39{
40  NSLog (@"Speak up, I didn't catch that.");
41}
42@end
43
44int
45main (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