Manman Ren | 01b705e | 2016-04-19 19:05:03 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-apple-macosx10.11 -emit-llvm -o - %s | FileCheck %s |
| 2 | // RUN: %clang_cc1 -triple x86_64-apple-macosx10.10 -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-NULL %s |
| 3 | // RUN: %clang_cc1 -triple x86_64-apple-macosx10.11 -emit-llvm -o - -fobjc-runtime=macosx-fragile-10.5 %s | FileCheck -check-prefix=CHECK-FRAGILE %s |
Manman Ren | 96df0b3 | 2016-01-29 23:45:01 +0000 | [diff] [blame] | 4 | |
Manman Ren | ce7bff5 | 2016-01-29 23:46:55 +0000 | [diff] [blame] | 5 | // CHECK: @"\01l_OBJC_$_CLASS_PROP_LIST_Proto" = private global {{.*}} section "__DATA, __objc_const", align 8 |
| 6 | // CHECK: @"\01l_OBJC_PROTOCOL_$_Proto" = {{.*}} global %struct._protocol_t { {{.*}} i32 96, i32 {{.*}} @"\01l_OBJC_$_CLASS_PROP_LIST_Proto" {{.*}} } |
Manman Ren | 96df0b3 | 2016-01-29 23:45:01 +0000 | [diff] [blame] | 7 | // CHECK: @"\01l_OBJC_$_CLASS_PROP_LIST_Foo_$_Category" = private global {{.*}} section "__DATA, __objc_const", align 8 |
Manman Ren | 42ff390 | 2016-02-24 17:49:50 +0000 | [diff] [blame] | 8 | // CHECK: @"\01l_OBJC_$_CATEGORY_Foo_$_Category" = private global %struct._category_t { {{.*}} @"\01l_OBJC_$_CLASS_PROP_LIST_Foo_$_Category" {{.*}}, i32 64 }, section "__DATA, __objc_const", align 8 |
Manman Ren | 96df0b3 | 2016-01-29 23:45:01 +0000 | [diff] [blame] | 9 | |
Manman Ren | 92e0a71 | 2016-02-21 05:31:05 +0000 | [diff] [blame] | 10 | // CHECK: @"\01l_OBJC_$_CLASS_PROP_LIST_C" = private global {{.*}} section "__DATA, __objc_const", align 8 |
| 11 | // CHECK: @"\01l_OBJC_METACLASS_RO_$_C" = private global %struct._class_ro_t { {{.*}} @"\01l_OBJC_$_CLASS_PROP_LIST_C" {{.*}} }, section "__DATA, __objc_const", align 8 |
| 12 | |
Manman Ren | 96df0b3 | 2016-01-29 23:45:01 +0000 | [diff] [blame] | 13 | // CHECK: !{i32 1, !"Objective-C Class Properties", i32 64} |
| 14 | |
Manman Ren | 01b705e | 2016-04-19 19:05:03 +0000 | [diff] [blame] | 15 | // CHECK-NULL-NOT: @"\01l_OBJC_$_CLASS_PROP_LIST_Proto" |
| 16 | // CHECK-NULL: @"\01l_OBJC_PROTOCOL_$_Proto" = {{.*}} global %struct._protocol_t { {{.*}} %struct._prop_list_t* null, i32 96, i32 {{.*}} %struct._prop_list_t* null } |
| 17 | // CHECK-NULL-NOT: @"\01l_OBJC_$_CLASS_PROP_LIST_Foo_$_Category" = private global {{.*}} section "__DATA, __objc_const", align 8 |
| 18 | // CHECK-NULL: @"\01l_OBJC_$_CATEGORY_Foo_$_Category" = private global %struct._category_t { {{.*}} %struct._prop_list_t* null, %struct._prop_list_t* null, {{.*}} }, section "__DATA, __objc_const", align 8 |
| 19 | |
| 20 | // CHECK-NULL-NOT: @"\01l_OBJC_$_CLASS_PROP_LIST_C" = private global {{.*}} section "__DATA, __objc_const", align 8 |
| 21 | // CHECK-NULL: @"\01l_OBJC_METACLASS_RO_$_C" = private global %struct._class_ro_t { {{.*}} %struct._prop_list_t* null }, section "__DATA, __objc_const", align 8 |
| 22 | |
| 23 | // CHECK-NULL: !{i32 1, !"Objective-C Class Properties", i32 64} |
| 24 | |
Manman Ren | ce7bff5 | 2016-01-29 23:46:55 +0000 | [diff] [blame] | 25 | // CHECK-FRAGILE: @"OBJC_$_CLASS_PROP_PROTO_LIST_Proto" = private global {{.*}} section "__OBJC,__property,regular,no_dead_strip", align 8 |
| 26 | // CHECK-FRAGILE: @"\01l_OBJC_PROTOCOLEXT_Proto" = private global %struct._objc_protocol_extension { i32 48, {{.*}} @"OBJC_$_CLASS_PROP_PROTO_LIST_Proto" {{.*}} }, align 8 |
Manman Ren | 96df0b3 | 2016-01-29 23:45:01 +0000 | [diff] [blame] | 27 | // CHECK-FRAGILE: @"\01l_OBJC_$_CLASS_PROP_LIST_Foo_Category" = private global {{.*}} section "__OBJC,__property,regular,no_dead_strip", align 8 |
| 28 | // CHECK-FRAGILE: @OBJC_CATEGORY_Foo_Category = private global %struct._objc_category { {{.*}}, i32 64, {{.*}} @"\01l_OBJC_$_CLASS_PROP_LIST_Foo_Category" {{.*}} }, section "__OBJC,__category,regular,no_dead_strip", align 8 |
| 29 | |
Manman Ren | 92e0a71 | 2016-02-21 05:31:05 +0000 | [diff] [blame] | 30 | // CHECK-FRAGILE: @"\01l_OBJC_$_CLASS_PROP_LIST_C" = private global {{.*}} section "__OBJC,__property,regular,no_dead_strip", align 8 |
| 31 | // CHECK-FRAGILE: @OBJC_CLASSEXT_C = private global %struct._objc_class_extension { {{.*}} @"\01l_OBJC_$_CLASS_PROP_LIST_C" {{.*}} }, section "__OBJC,__class_ext,regular,no_dead_strip", align 8 |
| 32 | |
Manman Ren | 96df0b3 | 2016-01-29 23:45:01 +0000 | [diff] [blame] | 33 | // CHECK-FRAGILE: !{i32 1, !"Objective-C Class Properties", i32 64} |
| 34 | |
| 35 | @interface Foo @end |
| 36 | |
| 37 | @protocol Proto |
| 38 | @property (class, readonly) int proto_property; |
| 39 | @end |
| 40 | |
| 41 | @interface Foo (Category) <Proto> @end |
| 42 | |
| 43 | @implementation Foo (Category) |
| 44 | +(int)proto_property { return 0; } |
| 45 | @end |
Manman Ren | 92e0a71 | 2016-02-21 05:31:05 +0000 | [diff] [blame] | 46 | |
| 47 | __attribute__((objc_root_class)) |
| 48 | @interface C |
| 49 | @property(class, readonly) int p; |
| 50 | @end |
| 51 | @implementation C |
| 52 | +(int)p { return 1; } |
| 53 | @end |