| Nico Weber | 08c9333 | 2015-12-03 17:44:51 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck %s |
| 2 | |
| 3 | // Checks metadata for properties in a few cases. |
| 4 | |
| 5 | |
| 6 | // Property from a class extension: |
| 7 | @interface Foo |
| 8 | @end |
| 9 | |
| 10 | @interface Foo() |
| 11 | @property int myprop; |
| 12 | @end |
| 13 | |
| 14 | @implementation Foo |
| 15 | @synthesize myprop = _myprop; |
| 16 | @end |
| 17 | // Metadata for _myprop should be present, and PROP_LIST for Foo should have |
| 18 | // only one entry. |
| 19 | // CHECK: = private global [12 x i8] c"Ti,V_myprop\00", |
| 20 | // CHECK: @"\01l_OBJC_$_PROP_LIST_Foo" = private global { i32, i32, [1 x %struct._prop_t] } |
| 21 | |
| 22 | // Readonly property in interface made readwrite in a category: |
| 23 | @interface FooRO |
| 24 | @property (readonly) int evolvingprop; |
| 25 | @end |
| 26 | |
| 27 | @interface FooRO () |
| 28 | @property int evolvingprop; |
| 29 | @end |
| 30 | |
| 31 | @implementation FooRO |
| 32 | @synthesize evolvingprop = _evolvingprop; |
| 33 | @end |
| 34 | // Metadata for _evolvingprop should be present, and PROP_LIST for FooRO should |
| 35 | // still have only one entry, and the one entry should point to the version of |
| 36 | // the property with a getter and setter. |
| 37 | // CHECK: [[getter:@OBJC_PROP_NAME_ATTR[^ ]+]] = private global [13 x i8] c"evolvingprop\00" |
| 38 | // CHECK: [[setter:@OBJC_PROP_NAME_ATTR[^ ]+]] = private global [18 x i8] c"Ti,V_evolvingprop\00", |
| 39 | // CHECK: @"\01l_OBJC_$_PROP_LIST_FooRO" = private global { i32, i32, [1 x %struct._prop_t] }{{.*}}[[getter]]{{.*}}[[setter]] |