Debian Codegraph @

clang/test/DebugInfo/ObjC/properties.m

raw
1 // RUN: %clang_cc1 -debug-info-kind=limited -emit-llvm -triple x86_64-apple-darwin -o - %s | FileCheck %s
2 // Check that we emit the correct method names for properties from a protocol.
3 @protocol NSObject
4 - (id)init;
5 @end
6 @interface NSObject <NSObject> {}
7 @end
8
9 @class Selection;
10
11 @protocol HasASelection <NSObject>
12 @property (nonatomic, retain) Selection* selection;
13 @end
14
15 @interface MyClass : NSObject <HasASelection> {
16 Selection *_selection;
17 }
18 @end
19
20 @implementation MyClass
21 @synthesize selection = _selection;
22 // CHECK: !DISubprogram(name: "-[MyClass selection]"
23 // CHECK-SAME: line: [[@LINE-2]]
24 // CHECK-SAME: DISPFlagLocalToUnit | DISPFlagDefinition
25 // CHECK: !DISubprogram(name: "-[MyClass setSelection:]"
26 // CHECK-SAME: line: [[@LINE-5]]
27 // CHECK-SAME: DISPFlagLocalToUnit | DISPFlagDefinition
28 @end
29
30 @interface OtherClass : NSObject <HasASelection> {
31 Selection *_selection;
32 }
33 @end
34 @implementation OtherClass
35 @synthesize selection = _selection;
36 // CHECK: !DISubprogram(name: "-[OtherClass selection]"
37 // CHECK-SAME: line: [[@LINE-2]]
38 // CHECK-SAME: DISPFlagLocalToUnit | DISPFlagDefinition
39 // CHECK: !DISubprogram(name: "-[OtherClass setSelection:]"
40 // CHECK-SAME: line: [[@LINE-5]]
41 // CHECK-SAME: DISPFlagLocalToUnit | DISPFlagDefinition
42 @end