1f4a2713aSLionel Sambuc// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-dispatch-method=mixed -emit-llvm -o - %s | FileCheck %s 2f4a2713aSLionel Sambuc 3f4a2713aSLionel Sambuc// CHECK: @"OBJC_IVAR_$_A._ivar" = global {{.*}} section "__DATA, __objc_ivar", align 8 4f4a2713aSLionel Sambuc// CHECK: @_objc_empty_cache = external global 5f4a2713aSLionel Sambuc// CHECK: @_objc_empty_vtable = external global 6f4a2713aSLionel Sambuc// CHECK: @"OBJC_CLASS_$_A" = global 7f4a2713aSLionel Sambuc// CHECK: @"OBJC_METACLASS_$_A" = global {{.*}} section "__DATA, __objc_data", align 8 8*0a6a1f1dSLionel Sambuc// CHECK: @OBJC_CLASS_NAME_{{[0-9]*}} = private global {{.*}} section "__TEXT,__objc_classname,cstring_literals", align 1 9*0a6a1f1dSLionel Sambuc// CHECK: @OBJC_METH_VAR_NAME_{{[0-9]*}} = private global {{.*}} section "__TEXT,__objc_methname,cstring_literals", align 1 10*0a6a1f1dSLionel Sambuc// CHECK: @OBJC_METH_VAR_TYPE_{{[0-9]*}} = private global {{.*}} section "__TEXT,__objc_methtype,cstring_literals", align 1 11*0a6a1f1dSLionel Sambuc// CHECK: @"\01l_OBJC_$_CLASS_METHODS_A" = private global {{.*}} section "__DATA, __objc_const", align 8 12*0a6a1f1dSLionel Sambuc// CHECK: @"\01l_OBJC_$_PROTOCOL_INSTANCE_METHODS_P" = private global {{.*}} section "__DATA, __objc_const", align 8 13*0a6a1f1dSLionel Sambuc// CHECK: @"\01l_OBJC_$_PROTOCOL_CLASS_METHODS_P" = private global {{.*}} section "__DATA, __objc_const", align 8 14f4a2713aSLionel Sambuc// CHECK: @"\01l_OBJC_PROTOCOL_$_P" = weak hidden global {{.*}} section "__DATA,__datacoal_nt,coalesced", align 8 15f4a2713aSLionel Sambuc// CHECK: @"\01l_OBJC_LABEL_PROTOCOL_$_P" = weak hidden global {{.*}} section "__DATA, __objc_protolist, coalesced, no_dead_strip", align 8 16*0a6a1f1dSLionel Sambuc// CHECK: @"\01l_OBJC_CLASS_PROTOCOLS_$_A" = private global {{.*}} section "__DATA, __objc_const", align 8 17*0a6a1f1dSLionel Sambuc// CHECK: @"\01l_OBJC_METACLASS_RO_$_A" = private global {{.*}} section "__DATA, __objc_const", align 8 18*0a6a1f1dSLionel Sambuc// CHECK: @"\01l_OBJC_$_INSTANCE_METHODS_A" = private global {{.*}} section "__DATA, __objc_const", align 8 19*0a6a1f1dSLionel Sambuc// CHECK: @"\01l_OBJC_$_INSTANCE_VARIABLES_A" = private global {{.*}} section "__DATA, __objc_const", align 8 20*0a6a1f1dSLionel Sambuc// CHECK: @OBJC_PROP_NAME_ATTR_{{[0-9]*}} = private global {{.*}} section "__TEXT,__cstring,cstring_literals", align 1 21*0a6a1f1dSLionel Sambuc// CHECK: @"\01l_OBJC_$_PROP_LIST_A" = private global {{.*}} section "__DATA, __objc_const", align 8 22*0a6a1f1dSLionel Sambuc// CHECK: @"\01l_OBJC_CLASS_RO_$_A" = private global {{.*}} section "__DATA, __objc_const", align 8 23*0a6a1f1dSLionel Sambuc// CHECK: @"\01l_OBJC_$_CATEGORY_INSTANCE_METHODS_A_$_Cat" = private global {{.*}} section "__DATA, __objc_const", align 8 24*0a6a1f1dSLionel Sambuc// CHECK: @"\01l_OBJC_$_CATEGORY_CLASS_METHODS_A_$_Cat" = private global {{.*}} section "__DATA, __objc_const", align 8 25*0a6a1f1dSLionel Sambuc// CHECK: @"\01l_OBJC_$_CATEGORY_A_$_Cat" = private global {{.*}} section "__DATA, __objc_const", align 8 26*0a6a1f1dSLionel Sambuc// CHECK: @"OBJC_CLASSLIST_SUP_REFS_$_{{[0-9]*}}" = private global {{.*}} section "__DATA, __objc_superrefs, regular, no_dead_strip", align 8 27*0a6a1f1dSLionel Sambuc// CHECK: @OBJC_SELECTOR_REFERENCES_ = private externally_initialized global {{.*}} section "__DATA, __objc_selrefs, literal_pointers, no_dead_strip" 28*0a6a1f1dSLionel Sambuc// CHECK: @"OBJC_CLASSLIST_SUP_REFS_$_{{[0-9]*}}" = private global {{.*}} section "__DATA, __objc_superrefs, regular, no_dead_strip", align 8 29f4a2713aSLionel Sambuc// CHECK: @"OBJC_CLASS_$_B" = external global 30*0a6a1f1dSLionel Sambuc// CHECK: @"OBJC_CLASSLIST_REFERENCES_$_{{[0-9]*}}" = private global {{.*}} section "__DATA, __objc_classrefs, regular, no_dead_strip", align 8 31f4a2713aSLionel Sambuc// CHECK: @"\01l_objc_msgSend_fixup_alloc" = weak hidden global {{.*}} section "__DATA, __objc_msgrefs, coalesced", align 16 32*0a6a1f1dSLionel Sambuc// CHECK: @"OBJC_LABEL_CLASS_$" = private global {{.*}} section "__DATA, __objc_classlist, regular, no_dead_strip", align 8 33*0a6a1f1dSLionel Sambuc// CHECK: @"OBJC_LABEL_CATEGORY_$" = private global {{.*}} section "__DATA, __objc_catlist, regular, no_dead_strip", align 8 34f4a2713aSLionel Sambuc// CHECK: @objc_msgSend_fpret( 35f4a2713aSLionel Sambuc// CHECK: @objc_msgSend_fixup( 36f4a2713aSLionel Sambuc 37f4a2713aSLionel Sambuc 38f4a2713aSLionel Sambuc/* 39f4a2713aSLionel Sambuc 40f4a2713aSLionel SambucHere is a handy command for looking at llvm-gcc's output: 41f4a2713aSLionel Sambucllvm-gcc -m64 -emit-llvm -S -o - metadata-symbols-64.m | \ 42f4a2713aSLionel Sambuc grep '=.*global' | \ 43f4a2713aSLionel Sambuc sed -e 's#global.*, section#global ... section#' | \ 44f4a2713aSLionel Sambuc sort 45f4a2713aSLionel Sambuc 46f4a2713aSLionel Sambuc*/ 47f4a2713aSLionel Sambuc 48f4a2713aSLionel Sambuc@interface B 49f4a2713aSLionel Sambuc@end 50f4a2713aSLionel Sambuc@interface C 51f4a2713aSLionel Sambuc@end 52f4a2713aSLionel Sambuc 53f4a2713aSLionel Sambuc@protocol P 54f4a2713aSLionel Sambuc+(void) fm0; 55f4a2713aSLionel Sambuc-(void) im0; 56f4a2713aSLionel Sambuc@end 57f4a2713aSLionel Sambuc 58f4a2713aSLionel Sambuc@interface A<P> { 59f4a2713aSLionel Sambuc int _ivar; 60f4a2713aSLionel Sambuc} 61f4a2713aSLionel Sambuc 62f4a2713aSLionel Sambuc@property (assign) int ivar; 63f4a2713aSLionel Sambuc 64f4a2713aSLionel Sambuc+(void) fm0; 65f4a2713aSLionel Sambuc-(void) im0; 66f4a2713aSLionel Sambuc@end 67f4a2713aSLionel Sambuc 68f4a2713aSLionel Sambuc@implementation A 69f4a2713aSLionel Sambuc@synthesize ivar = _ivar; 70f4a2713aSLionel Sambuc+(void) fm0 { 71f4a2713aSLionel Sambuc} 72f4a2713aSLionel Sambuc-(void) im0 { 73f4a2713aSLionel Sambuc} 74f4a2713aSLionel Sambuc@end 75f4a2713aSLionel Sambuc 76f4a2713aSLionel Sambuc@implementation A (Cat) 77f4a2713aSLionel Sambuc+(void) fm1 { 78f4a2713aSLionel Sambuc} 79f4a2713aSLionel Sambuc-(void) im1 { 80f4a2713aSLionel Sambuc} 81f4a2713aSLionel Sambuc@end 82f4a2713aSLionel Sambuc 83f4a2713aSLionel Sambuc@interface D : A 84f4a2713aSLionel Sambuc@end 85f4a2713aSLionel Sambuc 86f4a2713aSLionel Sambuc@implementation D 87f4a2713aSLionel Sambuc+(void) fm2 { 88f4a2713aSLionel Sambuc [super fm1]; 89f4a2713aSLionel Sambuc} 90f4a2713aSLionel Sambuc-(void) im2 { 91f4a2713aSLionel Sambuc [super im1]; 92f4a2713aSLionel Sambuc} 93f4a2713aSLionel Sambuc@end 94f4a2713aSLionel Sambuc 95f4a2713aSLionel Sambuc// Test for FP dispatch method APIs 96f4a2713aSLionel Sambuc@interface Example 97f4a2713aSLionel Sambuc@end 98f4a2713aSLionel Sambuc 99f4a2713aSLionel Sambucfloat FLOAT; 100f4a2713aSLionel Sambucdouble DOUBLE; 101f4a2713aSLionel Sambuclong double LONGDOUBLE; 102f4a2713aSLionel Sambucid ID; 103f4a2713aSLionel Sambuc 104f4a2713aSLionel Sambuc@implementation Example 105f4a2713aSLionel Sambuc - (double) RET_DOUBLE 106f4a2713aSLionel Sambuc { 107f4a2713aSLionel Sambuc return DOUBLE; 108f4a2713aSLionel Sambuc } 109f4a2713aSLionel Sambuc - (float) RET_FLOAT 110f4a2713aSLionel Sambuc { 111f4a2713aSLionel Sambuc return FLOAT; 112f4a2713aSLionel Sambuc } 113f4a2713aSLionel Sambuc - (long double) RET_LONGDOUBLE 114f4a2713aSLionel Sambuc { 115f4a2713aSLionel Sambuc return LONGDOUBLE; 116f4a2713aSLionel Sambuc } 117f4a2713aSLionel Sambuc@end 118f4a2713aSLionel Sambuc 119f4a2713aSLionel Sambucvoid *f0(id x) { 120f4a2713aSLionel Sambuc Example* pe; 121f4a2713aSLionel Sambuc double dd = [pe RET_DOUBLE]; 122f4a2713aSLionel Sambuc dd = [pe RET_FLOAT]; 123f4a2713aSLionel Sambuc dd = [pe RET_LONGDOUBLE]; 124f4a2713aSLionel Sambuc 125f4a2713aSLionel Sambuc [B im0]; 126f4a2713aSLionel Sambuc [C im1]; 127f4a2713aSLionel Sambuc [D alloc]; 128f4a2713aSLionel Sambuc} 129f4a2713aSLionel Sambuc 130