annotate clang/test/CodeGenObjC/debug-info-property-class-extension.m @ 180:680fa57a2f20

fix compile errors.
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 30 May 2020 17:44:06 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -S -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 // Checks debug info for properties from class extensions for a few cases.
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5
anatofuz
parents:
diff changeset
6 // Readonly property in interface made readwrite in a category, with @impl
anatofuz
parents:
diff changeset
7 // The interesting bit is that when the ivar debug info is generated, the corresponding
anatofuz
parents:
diff changeset
8 // property is looked up and also gets debug info. If the debug info from the interface's
anatofuz
parents:
diff changeset
9 // declaration and from the ivar doesn't match, this will end up with two DIObjCProperty
anatofuz
parents:
diff changeset
10 // entries which would be bad.
anatofuz
parents:
diff changeset
11 @interface FooROWithImpl
anatofuz
parents:
diff changeset
12 // CHECK-NOT: !DIObjCProperty(name: "evolvingpropwithimpl"{{.*}}line: [[@LINE+1]]
anatofuz
parents:
diff changeset
13 @property (readonly) int evolvingpropwithimpl;
anatofuz
parents:
diff changeset
14 @end
anatofuz
parents:
diff changeset
15 @interface FooROWithImpl ()
anatofuz
parents:
diff changeset
16 // CHECK: !DIObjCProperty(name: "evolvingpropwithimpl"{{.*}}line: [[@LINE+1]]
anatofuz
parents:
diff changeset
17 @property int evolvingpropwithimpl;
anatofuz
parents:
diff changeset
18 @end
anatofuz
parents:
diff changeset
19 @implementation FooROWithImpl
anatofuz
parents:
diff changeset
20 @synthesize evolvingpropwithimpl = _evolvingpropwithimpl;
anatofuz
parents:
diff changeset
21 @end
anatofuz
parents:
diff changeset
22
anatofuz
parents:
diff changeset
23
anatofuz
parents:
diff changeset
24 // Simple property from a class extension:
anatofuz
parents:
diff changeset
25 @interface Foo
anatofuz
parents:
diff changeset
26 @end
anatofuz
parents:
diff changeset
27 @interface Foo()
anatofuz
parents:
diff changeset
28 // CHECK: !DIObjCProperty(name: "myprop"{{.*}}line: [[@LINE+1]]
anatofuz
parents:
diff changeset
29 @property int myprop;
anatofuz
parents:
diff changeset
30 @end
anatofuz
parents:
diff changeset
31 // There's intentionally no @implementation for Foo, because that would
anatofuz
parents:
diff changeset
32 // generate debug info for the property via the backing ivar.
anatofuz
parents:
diff changeset
33
anatofuz
parents:
diff changeset
34
anatofuz
parents:
diff changeset
35 // Readonly property in interface made readwrite in a category:
anatofuz
parents:
diff changeset
36 @interface FooRO
anatofuz
parents:
diff changeset
37 // Shouldn't be here but in the class extension below.
anatofuz
parents:
diff changeset
38 // CHECK-NOT: !DIObjCProperty(name: "evolvingprop"{{.*}}line: [[@LINE+1]]
anatofuz
parents:
diff changeset
39 @property (readonly) int evolvingprop;
anatofuz
parents:
diff changeset
40 @end
anatofuz
parents:
diff changeset
41 @interface FooRO ()
anatofuz
parents:
diff changeset
42 // CHECK: !DIObjCProperty(name: "evolvingprop"{{.*}}line: [[@LINE+1]]
anatofuz
parents:
diff changeset
43 @property int evolvingprop;
anatofuz
parents:
diff changeset
44 @end
anatofuz
parents:
diff changeset
45
anatofuz
parents:
diff changeset
46
anatofuz
parents:
diff changeset
47 // This references types in this file to force emission of their debug info.
anatofuz
parents:
diff changeset
48 void foo(Foo *f, FooRO *g, FooROWithImpl* h) { }