1f4a2713aSLionel Sambuc// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck %s 2f4a2713aSLionel Sambuc 3f4a2713aSLionel Sambuc// CHECK: .lazy_reference .objc_class_name_J0 4f4a2713aSLionel Sambuc 5*0a6a1f1dSLionel Sambuc// CHECK: @OBJC_METH_VAR_NAME_{{[0-9]*}} = private global {{.*}}section "__TEXT,__cstring,cstring_literals", align 1 6*0a6a1f1dSLionel Sambuc// CHECK: @OBJC_METH_VAR_TYPE_{{[0-9]*}} = private global {{.*}}section "__TEXT,__cstring,cstring_literals", align 1 7*0a6a1f1dSLionel Sambuc// CHECK: @"\01l_OBJC_PROTOCOLEXT_P" = private global 8*0a6a1f1dSLionel Sambuc// CHECK-NOT: section 9*0a6a1f1dSLionel Sambuc// CHECK: @OBJC_CLASS_NAME_{{[0-9]*}} = private global {{.*}}section "__TEXT,__cstring,cstring_literals", align 1 10*0a6a1f1dSLionel Sambuc// CHECK: @OBJC_PROTOCOL_INSTANCE_METHODS_P = private global {{.*}}section "__OBJC,__cat_inst_meth,regular,no_dead_strip", align 4 11*0a6a1f1dSLionel Sambuc// CHECK: @OBJC_PROTOCOL_CLASS_METHODS_P = private global {{.*}}section "__OBJC,__cat_cls_meth,regular,no_dead_strip", align 4 12*0a6a1f1dSLionel Sambuc// CHECK: @OBJC_PROTOCOL_P = private global {{.*}}section "__OBJC,__protocol,regular,no_dead_strip", align 4 13*0a6a1f1dSLionel Sambuc// CHECK: @OBJC_CLASS_PROTOCOLS_A = private global {{.*}}section "__OBJC,__cat_cls_meth,regular,no_dead_strip", align 4 14*0a6a1f1dSLionel Sambuc// CHECK: @OBJC_CLASS_METHODS_A = private global {{.*}}section "__OBJC,__cls_meth,regular,no_dead_strip", align 4 15*0a6a1f1dSLionel Sambuc// CHECK: @OBJC_METACLASS_A = private global {{.*}}section "__OBJC,__meta_class,regular,no_dead_strip", align 4 16*0a6a1f1dSLionel Sambuc// CHECK: @OBJC_INSTANCE_VARIABLES_A = private global {{.*}}section "__OBJC,__instance_vars,regular,no_dead_strip", align 4 17*0a6a1f1dSLionel Sambuc// CHECK: @OBJC_INSTANCE_METHODS_A = private global {{.*}}section "__OBJC,__inst_meth,regular,no_dead_strip", align 4 18*0a6a1f1dSLionel Sambuc// CHECK: @OBJC_PROP_NAME_ATTR_{{[0-9]*}} = private global {{.*}}section "__TEXT,__cstring,cstring_literals", align 1 19*0a6a1f1dSLionel Sambuc// CHECK: @"\01l_OBJC_$_PROP_LIST_A" = private global {{.*}}section "__OBJC,__property,regular,no_dead_strip", align 4 20*0a6a1f1dSLionel Sambuc// CHECK: @OBJC_CLASSEXT_A = private global {{.*}}section "__OBJC,__class_ext,regular,no_dead_strip", align 4 21*0a6a1f1dSLionel Sambuc// CHECK: @OBJC_CLASS_A = private global {{.*}}section "__OBJC,__class,regular,no_dead_strip", align 4 22*0a6a1f1dSLionel Sambuc// CHECK: @OBJC_CATEGORY_INSTANCE_METHODS_A_Cat = private global {{.*}}section "__OBJC,__cat_inst_meth,regular,no_dead_strip", align 4 23*0a6a1f1dSLionel Sambuc// CHECK: @OBJC_CATEGORY_CLASS_METHODS_A_Cat = private global {{.*}}section "__OBJC,__cat_cls_meth,regular,no_dead_strip", align 4 24*0a6a1f1dSLionel Sambuc// CHECK: @OBJC_CATEGORY_A_Cat = private global {{.*}}section "__OBJC,__category,regular,no_dead_strip", align 4 25*0a6a1f1dSLionel Sambuc// CHECK: @OBJC_CLASS_REFERENCES_{{[0-9]*}} = private global {{.*}}section "__OBJC,__cls_refs,literal_pointers,no_dead_strip", align 4 26*0a6a1f1dSLionel Sambuc// CHECK: @OBJC_SELECTOR_REFERENCES_{{[0-9]*}} = private externally_initialized global {{.*}}section "__OBJC,__message_refs,literal_pointers,no_dead_strip", align 4 27*0a6a1f1dSLionel Sambuc// CHECK: @OBJC_SYMBOLS = private global {{.*}}section "__OBJC,__symbols,regular,no_dead_strip", align 4 28*0a6a1f1dSLionel Sambuc// CHECK: @OBJC_MODULES = private global {{.*}}section "__OBJC,__module_info,regular,no_dead_strip", align 4 29f4a2713aSLionel Sambuc 30f4a2713aSLionel Sambuc// Clang's Obj-C 32-bit doesn't emit ivars for the root class. 31*0a6a1f1dSLionel Sambuc// CHECKX: @"\01L_OBJC_CLASS_VARIABLES_A" = private global {{.*}}section "__OBJC,__class_vars,regular,no_dead_strip", align 4 32f4a2713aSLionel Sambuc 33f4a2713aSLionel Sambuc 34f4a2713aSLionel Sambuc/* 35f4a2713aSLionel Sambuc 36f4a2713aSLionel SambucHere is a handy command for looking at llvm-gcc's output: 37f4a2713aSLionel Sambucllvm-gcc -m32 -emit-llvm -S -o - metadata-symbols-32.m | \ 38f4a2713aSLionel Sambuc grep '=.*global' | \ 39f4a2713aSLionel Sambuc sed -e 's#global.*, section#global ... section#' | \ 40f4a2713aSLionel Sambuc sort 41f4a2713aSLionel Sambuc 42f4a2713aSLionel Sambuc*/ 43f4a2713aSLionel Sambuc 44f4a2713aSLionel Sambuc@interface B 45f4a2713aSLionel Sambuc@end 46f4a2713aSLionel Sambuc@interface C 47f4a2713aSLionel Sambuc@end 48f4a2713aSLionel Sambuc 49f4a2713aSLionel Sambuc@protocol P 50f4a2713aSLionel Sambuc+(void) fm0; 51f4a2713aSLionel Sambuc-(void) im0; 52f4a2713aSLionel Sambuc@end 53f4a2713aSLionel Sambuc 54f4a2713aSLionel Sambuc@interface A<P> { 55f4a2713aSLionel Sambuc int _ivar; 56f4a2713aSLionel Sambuc} 57f4a2713aSLionel Sambuc 58f4a2713aSLionel Sambuc@property (assign) int ivar; 59f4a2713aSLionel Sambuc 60f4a2713aSLionel Sambuc+(void) fm0; 61f4a2713aSLionel Sambuc-(void) im0; 62f4a2713aSLionel Sambuc@end 63f4a2713aSLionel Sambuc 64f4a2713aSLionel Sambuc@implementation A 65f4a2713aSLionel Sambuc@synthesize ivar = _ivar; 66f4a2713aSLionel Sambuc+(void) fm0 { 67f4a2713aSLionel Sambuc} 68f4a2713aSLionel Sambuc-(void) im0 { 69f4a2713aSLionel Sambuc} 70f4a2713aSLionel Sambuc@end 71f4a2713aSLionel Sambuc 72f4a2713aSLionel Sambuc@implementation A (Cat) 73f4a2713aSLionel Sambuc+(void) fm1 { 74f4a2713aSLionel Sambuc} 75f4a2713aSLionel Sambuc-(void) im1 { 76f4a2713aSLionel Sambuc} 77f4a2713aSLionel Sambuc@end 78f4a2713aSLionel Sambuc 79f4a2713aSLionel Sambuc@interface J0 80f4a2713aSLionel Sambuc@end 81f4a2713aSLionel Sambuc 82f4a2713aSLionel Sambuc@implementation J0(Category) @end 83f4a2713aSLionel Sambuc 84f4a2713aSLionel Sambucvoid *f0() { 85f4a2713aSLionel Sambuc [B im0]; 86f4a2713aSLionel Sambuc [C im1]; 87f4a2713aSLionel Sambuc} 88f4a2713aSLionel Sambuc 89