1 // RUN: %clang_cc1 -Wno-objc-root-class -emit-llvm -triple x86_64-apple-darwin %s -o - | FileCheck %s
3 __attribute__((objc_runtime_name("MySecretNamespace.Protocol")))
9 __attribute__((objc_runtime_name("MySecretNamespace.Protocol2")))
15 @property(retain) id optionalProp;
19 __attribute__((objc_runtime_name("MySecretNamespace.Protocol3")))
23 __attribute__((objc_runtime_name("MySecretNamespace.Message")))
24 @interface Message <Protocol, Protocol2> {
28 @property(retain) Message *msgProp;
29 @property(retain) Message<Protocol3> *msgProtoProp;
30 @property(retain) id<Protocol3> idProtoProp;
34 @implementation Message
46 + (void) ClsMethodP {}
47 + (void) ClsMethodP2 {}
50 __attribute__((objc_runtime_name("foo")))
53 + (instancetype)alloc;
56 id Test16877359(void) {
57 return [SLREarth alloc];
60 // CHECK: @"OBJC_IVAR_$_MySecretNamespace.Message.MyIVAR" ={{.*}} global i64 0
61 // CHECK: @"OBJC_CLASS_$_MySecretNamespace.Message" ={{.*}} global %struct._class_t
62 // CHECK: @"OBJC_METACLASS_$_MySecretNamespace.Message" ={{.*}} global %struct._class_t
64 // CHECK: @OBJC_PROP_NAME_ATTR_ = private unnamed_addr constant [13 x i8] c"optionalProp\00"
65 // CHECK-NEXT: @OBJC_PROP_NAME_ATTR_.11 = private unnamed_addr constant [7 x i8] c"T@,?,&\00"
66 // CHECK: @"_OBJC_$_PROP_LIST_MySecretNamespace.Protocol2" ={{.*}} [%struct._prop_t { ptr @OBJC_PROP_NAME_ATTR_, ptr @OBJC_PROP_NAME_ATTR_.11 }]
68 // CHECK: private unnamed_addr constant [42 x i8] c"T@\22MySecretNamespace.Message\22,&,V_msgProp\00"
69 // CHECK: private unnamed_addr constant [76 x i8] c"T@\22MySecretNamespace.Message<MySecretNamespace.Protocol3>\22,&,V_msgProtoProp\00"
70 // CHECK: private unnamed_addr constant [50 x i8] c"T@\22<MySecretNamespace.Protocol3>\22,&,V_idProtoProp\00"
72 // CHECK: @"OBJC_CLASS_$_foo" = external global %struct._class_t
73 // CHECK: define internal ptr @"\01-[Message MyMethod]"
74 // CHECK: [[IVAR:%.*]] = load i64, ptr @"OBJC_IVAR_$_MySecretNamespace.Message.MyIVAR"