72 lines · plain
1// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s \2// RUN: -fobjc-dispatch-method=legacy | \3// RUN: FileCheck -check-prefix CHECK-FRAGILE_LEGACY %s4//5// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-llvm -o - %s \6// RUN: -fobjc-dispatch-method=legacy | \7// RUN: FileCheck -check-prefix CHECK-NONFRAGILE_LEGACY %s8//9// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-llvm -o - %s \10// RUN: -fobjc-dispatch-method=non-legacy | \11// RUN: FileCheck -check-prefix CHECK-NONFRAGILE_NONLEGACY %s12//13// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-llvm -o - %s \14// RUN: -fobjc-dispatch-method=mixed | \15// RUN: FileCheck -check-prefix CHECK-NONFRAGILE_MIXED %s16 17// There are basically four ways that we end up doing message dispatch for the18// NeXT runtime. They are:19// (1) fragile ABI, legacy dispatch20// (2) non-fragile ABI, legacy dispatch21// (2) non-fragile ABI, non-legacy dispatch22// (2) non-fragile ABI, mixed dispatch23//24// Note that fragile ABI and non-fragile ABI legacy dispatch are not the same,25// they use some different API calls (objc_msgSendSuper vs objc_msgSendSuper2).26 27// CHECK-FRAGILE_LEGACY: ModuleID28// CHECK-FRAGILE_LEGACY-NOT: declare ptr @objc_msgSendSuper2_fixup(29// CHECK-FRAGILE_LEGACY-NOT: declare ptr @objc_msgSend_fixup(30// CHECK-FRAGILE_LEGACY: declare ptr @objc_msgSendSuper(31// CHECK-FRAGILE_LEGACY: declare ptr @objc_msgSend(32 33// CHECK-NONFRAGILE_LEGACY: ModuleID34// CHECK-NONFRAGILE_LEGACY-NOT: declare ptr @objc_msgSendSuper2_fixup(35// CHECK-NONFRAGILE_LEGACY-NOT: declare ptr @objc_msgSend_fixup(36// CHECK-NONFRAGILE_LEGACY: declare ptr @objc_msgSendSuper2(37// CHECK-NONFRAGILE_LEGACY: declare ptr @objc_msgSend(38 39// CHECK-NONFRAGILE_NONLEGACY: ModuleID40// CHECK-NONFRAGILE_NONLEGACY: declare ptr @objc_msgSendSuper2_fixup(41// CHECK-NONFRAGILE_NONLEGACY: declare ptr @objc_msgSend_fixup(42 43// CHECK-NONFRAGILE_MIXED: declare ptr @objc_msgSendSuper2_fixup(44// CHECK-NONFRAGILE_MIXED: declare ptr @objc_msgSendSuper2(45// CHECK-NONFRAGILE_MIXED: declare ptr @objc_msgSend_fixup(46// CHECK-NONFRAGILE_MIXED: declare ptr @objc_msgSend(47 48@interface NSObject49+ (id)alloc;50- (id)init;51@end52 53@interface I0 : NSObject54-(void) im0;55@end56 57@implementation I058+(id) alloc {59 return [super alloc];60}61-(id) init {62 [super init];63 return self;64}65-(void) im0 {}66@end67 68void f0(I0 *a) {69 [I0 alloc];70 [a im0];71}72