Name += "objc_msgSend_stret_fixup";
}
}
- else if (ResultType->isFloatingType() &&
- // Selection of frret API only happens in 32bit nonfragile ABI.
- CGM.getTargetData().getTypePaddedSize(ObjCTypes.LongTy) == 4) {
- Fn = ObjCTypes.getMessageSendFpretFixupFn();
- Name += "objc_msgSend_fpret_fixup";
+ else if (!IsSuper && ResultType->isFloatingType()) {
+ if (const BuiltinType *BT = ResultType->getAsBuiltinType()) {
+ BuiltinType::Kind k = BT->getKind();
+ if (k == BuiltinType::LongDouble) {
+ Fn = ObjCTypes.getMessageSendFpretFixupFn();
+ Name += "objc_msgSend_fpret_fixup";
+ }
+ else {
+ Fn = ObjCTypes.getMessageSendFixupFn();
+ Name += "objc_msgSend_fixup";
+ }
+ }
}
else {
#if 0
// RUN: grep '@"\\01l_objc_msgSend_fixup_alloc" = weak hidden global .* section "__DATA, __objc_msgrefs, coalesced", align 16' %t &&
// RUN: grep '@_objc_empty_cache = external global' %t &&
// RUN: grep '@_objc_empty_vtable = external global' %t &&
+// RUN: grep '@objc_msgSend_fixup(' %t &&
+// RUN: grep '@objc_msgSend_fpret_fixup(' %t &&
// RUN: true
}
@end
+// 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
+
void *f0(id x) {
+ Example* pe;
+ double dd = [pe RET_DOUBLE];
+ dd = [pe RET_FLOAT];
+ dd = [pe RET_LONGDOUBLE];
+
[B im0];
[C im1];
[D alloc];