51 lines · plain
1// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s2 3@interface NSObject4+ (id)alloc;5- (id)init;6- (id)retain;7@end8 9@interface NSString : NSObject10@end11 12// CHECK-LABEL: define {{.*}}void @test1()13void test1(void) {14 // CHECK: {{call.*@objc_msgSend}}15 // CHECK: {{call.*@objc_msgSend}}16 // CHECK: {{call.*@objc_msgSend}}17 NSString *str1 = [[[NSString alloc] init] retain];18}19 20// CHECK-LABEL: define {{.*}}void @test2()21void test2(void) {22 // CHECK: {{call.*@objc_msgSend}}23 // CHECK: {{call.*@objc_msgSend}}24 // CHECK: {{call.*@objc_msgSend}}25 NSString *str1 = NSString.alloc.init.retain;26}27 28@interface Test2 : NSString29- (id)init;30@end31 32@implementation Test233// CHECK: define internal {{.*}}ptr @"\01-[Test2 init]"34- (id)init {35 // CHECK: {{call.*@objc_msgSendSuper}}36 return [super init];37}38@end39 40@interface Test3 : NSString41- (id)init;42@end43 44@implementation Test345// CHECK: define internal {{.*}}ptr @"\01-[Test3 init]"46- (id)init {47 // CHECK: {{call.*@objc_msgSendSuper}}48 return [super init];49}50@end51