1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-weak -fobjc-runtime-has-weak -emit-llvm %s -o - | FileCheck %s
3 // Checks metadata for properties in a few cases.
6 // Property from a class extension:
7 __attribute__((objc_root_class))
16 @synthesize myprop = _myprop;
18 // Metadata for _myprop should be present, and PROP_LIST for Foo should have
20 // CHECK: = private unnamed_addr constant [12 x i8] c"Ti,V_myprop\00",
21 // CHECK: @"_OBJC_$_PROP_LIST_Foo" = internal global { i32, i32, [1 x %struct._prop_t] }
23 // Readonly property in interface made readwrite in a category:
24 __attribute__((objc_root_class))
26 @property (readonly) int evolvingprop;
27 @property (nonatomic,readonly,getter=isBooleanProp) int booleanProp;
28 @property (nonatomic,readonly,weak) Foo *weakProp;
32 @property int evolvingprop;
33 @property int booleanProp;
34 @property Foo *weakProp;
38 @synthesize evolvingprop = _evolvingprop;
40 // Metadata for _evolvingprop should be present, and PROP_LIST for FooRO should
41 // still have only one entry, and the one entry should point to the version of
42 // the property with a getter and setter.
43 // CHECK: [[evolvinggetter:@OBJC_PROP_NAME_ATTR[^ ]+]] = private unnamed_addr constant [13 x i8] c"evolvingprop\00"
44 // CHECK: [[evolvingsetter:@OBJC_PROP_NAME_ATTR[^ ]+]] = private unnamed_addr constant [18 x i8] c"Ti,V_evolvingprop\00",
45 // CHECK: [[booleanmetadata:@OBJC_PROP_NAME_ATTR[^ ]+]] = private unnamed_addr constant [34 x i8] c"Ti,N,GisBooleanProp,V_booleanProp\00"
46 // CHECK: [[weakmetadata:@OBJC_PROP_NAME_ATTR[^ ]+]] = private unnamed_addr constant [23 x i8] c"T@\22Foo\22,W,N,V_weakProp\00"
47 // CHECK: @"_OBJC_$_PROP_LIST_FooRO" = internal global { i32, i32, [3 x %struct._prop_t] }{{.*}}[[evolvinggetter]]{{.*}}[[evolvingsetter]]{{.*}}[[booleanmetadata]]