2013-04-11 21:24:56 +08:00
|
|
|
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-dispatch-method=mixed -emit-llvm -o - %s | FileCheck %s
|
2010-04-13 01:25:51 +08:00
|
|
|
|
2013-04-11 21:24:56 +08:00
|
|
|
// CHECK: @"OBJC_IVAR_$_A._ivar" = global {{.*}} section "__DATA, __objc_ivar", align 8
|
|
|
|
// CHECK: @_objc_empty_cache = external global
|
|
|
|
// CHECK: @_objc_empty_vtable = external global
|
|
|
|
// CHECK: @"OBJC_CLASS_$_A" = global
|
|
|
|
// CHECK: @"OBJC_METACLASS_$_A" = global {{.*}} section "__DATA, __objc_data", align 8
|
2016-09-19 00:12:14 +08:00
|
|
|
// CHECK: @OBJC_CLASS_NAME_{{[0-9]*}} = private unnamed_addr constant {{.*}} section "__TEXT,__objc_classname,cstring_literals", align 1
|
|
|
|
// CHECK: @OBJC_METH_VAR_NAME_{{[0-9]*}} = private unnamed_addr constant {{.*}} section "__TEXT,__objc_methname,cstring_literals", align 1
|
|
|
|
// CHECK: @OBJC_METH_VAR_TYPE_{{[0-9]*}} = private unnamed_addr constant {{.*}} section "__TEXT,__objc_methtype,cstring_literals", align 1
|
2019-05-10 01:43:52 +08:00
|
|
|
// CHECK: @"_OBJC_$_CLASS_METHODS_A" = internal global {{.*}} section "__DATA, __objc_const", align 8
|
|
|
|
// CHECK: @"_OBJC_$_PROTOCOL_INSTANCE_METHODS_P" = internal global {{.*}} section "__DATA, __objc_const", align 8
|
|
|
|
// CHECK: @"_OBJC_$_PROTOCOL_CLASS_METHODS_P" = internal global {{.*}} section "__DATA, __objc_const", align 8
|
2019-03-14 23:17:37 +08:00
|
|
|
// CHECK: @"_OBJC_PROTOCOL_$_P" = weak hidden global {{.*}}, align 8
|
|
|
|
// CHECK: @"_OBJC_LABEL_PROTOCOL_$_P" = weak hidden global {{.*}} section "__DATA,__objc_protolist,coalesced,no_dead_strip", align 8
|
2019-05-10 01:43:52 +08:00
|
|
|
// CHECK: @"_OBJC_CLASS_PROTOCOLS_$_A" = internal global {{.*}} section "__DATA, __objc_const", align 8
|
|
|
|
// CHECK: @"_OBJC_METACLASS_RO_$_A" = internal global {{.*}} section "__DATA, __objc_const", align 8
|
|
|
|
// CHECK: @"_OBJC_$_INSTANCE_METHODS_A" = internal global {{.*}} section "__DATA, __objc_const", align 8
|
|
|
|
// CHECK: @"_OBJC_$_INSTANCE_VARIABLES_A" = internal global {{.*}} section "__DATA, __objc_const", align 8
|
2020-03-11 02:42:47 +08:00
|
|
|
// CHECK: @OBJC_PROP_NAME_ATTR_{{[0-9]*}} = private unnamed_addr constant {{.*}} section "__TEXT,__objc_methname,cstring_literals", align 1
|
2019-05-10 01:43:52 +08:00
|
|
|
// CHECK: @"_OBJC_$_PROP_LIST_A" = internal global {{.*}} section "__DATA, __objc_const", align 8
|
|
|
|
// CHECK: @"_OBJC_CLASS_RO_$_A" = internal global {{.*}} section "__DATA, __objc_const", align 8
|
|
|
|
// CHECK: @"_OBJC_$_CATEGORY_INSTANCE_METHODS_A_$_Cat" = internal global {{.*}} section "__DATA, __objc_const", align 8
|
|
|
|
// CHECK: @"_OBJC_$_CATEGORY_CLASS_METHODS_A_$_Cat" = internal global {{.*}} section "__DATA, __objc_const", align 8
|
|
|
|
// CHECK: @"_OBJC_$_CATEGORY_A_$_Cat" = internal global {{.*}} section "__DATA, __objc_const", align 8
|
2020-03-10 03:17:23 +08:00
|
|
|
// CHECK: @"OBJC_CLASSLIST_SUP_REFS_$_{{[0-9]*}}" = private global {{.*}} section "__DATA,__objc_superrefs,regular,no_dead_strip", align 8
|
2019-05-10 01:43:52 +08:00
|
|
|
// CHECK: @OBJC_SELECTOR_REFERENCES_ = internal externally_initialized global {{.*}} section "__DATA,__objc_selrefs,literal_pointers,no_dead_strip"
|
2020-03-10 03:17:23 +08:00
|
|
|
// CHECK: @"OBJC_CLASSLIST_SUP_REFS_$_{{[\.0-9]*}}" = private global {{.*}} section "__DATA,__objc_superrefs,regular,no_dead_strip", align 8
|
2013-04-11 21:24:56 +08:00
|
|
|
// CHECK: @"OBJC_CLASS_$_B" = external global
|
2019-05-10 01:43:52 +08:00
|
|
|
// CHECK: @"OBJC_CLASSLIST_REFERENCES_$_{{[0-9]*}}" = internal global {{.*}} section "__DATA,__objc_classrefs,regular,no_dead_strip", align 8
|
|
|
|
// CHECK: @_objc_msgSend_fixup_alloc = weak hidden global {{.*}} section "__DATA,__objc_msgrefs,coalesced", align 16
|
2020-03-10 03:17:23 +08:00
|
|
|
// CHECK: @"OBJC_LABEL_CLASS_$" = private global {{.*}} section "__DATA,__objc_classlist,regular,no_dead_strip", align 8
|
|
|
|
// CHECK: @"OBJC_LABEL_CATEGORY_$" = private global {{.*}} section "__DATA,__objc_catlist,regular,no_dead_strip", align 8
|
2013-04-11 21:24:56 +08:00
|
|
|
// CHECK: @objc_msgSend_fpret(
|
|
|
|
// CHECK: @objc_msgSend_fixup(
|
2009-04-15 10:56:18 +08:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
Here is a handy command for looking at llvm-gcc's output:
|
|
|
|
llvm-gcc -m64 -emit-llvm -S -o - metadata-symbols-64.m | \
|
|
|
|
grep '=.*global' | \
|
|
|
|
sed -e 's#global.*, section#global ... section#' | \
|
|
|
|
sort
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@interface B
|
|
|
|
@end
|
|
|
|
@interface C
|
|
|
|
@end
|
|
|
|
|
|
|
|
@protocol P
|
|
|
|
+(void) fm0;
|
|
|
|
-(void) im0;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface A<P> {
|
|
|
|
int _ivar;
|
|
|
|
}
|
|
|
|
|
|
|
|
@property (assign) int ivar;
|
|
|
|
|
|
|
|
+(void) fm0;
|
|
|
|
-(void) im0;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation A
|
|
|
|
@synthesize ivar = _ivar;
|
|
|
|
+(void) fm0 {
|
|
|
|
}
|
|
|
|
-(void) im0 {
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation A (Cat)
|
|
|
|
+(void) fm1 {
|
|
|
|
}
|
|
|
|
-(void) im1 {
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
2009-04-16 03:03:14 +08:00
|
|
|
@interface D : A
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation D
|
|
|
|
+(void) fm2 {
|
|
|
|
[super fm1];
|
|
|
|
}
|
|
|
|
-(void) im2 {
|
|
|
|
[super im1];
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
2009-05-01 00:31:11 +08:00
|
|
|
// Test for FP dispatch method APIs
|
|
|
|
@interface Example
|
|
|
|
@end
|
|
|
|
|
|
|
|
float FLOAT;
|
|
|
|
double DOUBLE;
|
|
|
|
long double LONGDOUBLE;
|
|
|
|
id ID;
|
|
|
|
|
|
|
|
@implementation Example
|
|
|
|
- (double) RET_DOUBLE
|
|
|
|
{
|
|
|
|
return DOUBLE;
|
|
|
|
}
|
|
|
|
- (float) RET_FLOAT
|
|
|
|
{
|
|
|
|
return FLOAT;
|
|
|
|
}
|
|
|
|
- (long double) RET_LONGDOUBLE
|
|
|
|
{
|
|
|
|
return LONGDOUBLE;
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
2009-04-16 03:03:14 +08:00
|
|
|
void *f0(id x) {
|
2009-05-01 00:31:11 +08:00
|
|
|
Example* pe;
|
|
|
|
double dd = [pe RET_DOUBLE];
|
|
|
|
dd = [pe RET_FLOAT];
|
|
|
|
dd = [pe RET_LONGDOUBLE];
|
|
|
|
|
2009-04-15 10:56:18 +08:00
|
|
|
[B im0];
|
|
|
|
[C im1];
|
2009-04-16 03:03:14 +08:00
|
|
|
[D alloc];
|
2009-04-15 10:56:18 +08:00
|
|
|
}
|
|
|
|
|