38 lines · plain
1// RUN: %clang_cc1 -triple x86_64-unknown-freebsd -emit-llvm -fobjc-runtime=gnustep-2.2 -o - %s | FileCheck %s2 3@interface X4@end5 6@implementation X7//- (int)x __attribute__((objc_direct)) { return 12; }8- (int)x __attribute__((objc_direct)) { return 12; }9 10// Check that the name is mangled like Objective-C methods and contains a nil check11// CHECK-LABEL: @_i_X__x12// CHECK: icmp eq ptr %0, null13 14+ (int)clsMeth __attribute__((objc_direct)) { return 42; }15// Check that the name is mangled like Objective-C methods and contains an initialisation check16// CHECK-LABEL: @_c_X__clsMeth17// CHECK: getelementptr inbounds nuw { ptr, ptr, ptr, i64, i64 }, ptr %0, i32 0, i32 418// CHECK: load i64, ptr %1, align 6419// CHECK: and i64 %2, 25620// CHECK: objc_direct_method.class_uninitialized:21// CHECK: call void @objc_send_initialize(ptr %0)22 23@end24 25// Check that the call sides are set up correctly.26void callCls(void)27{28 // CHECK: call i32 @_c_X__clsMeth29 [X clsMeth];30}31 32void callInstance(X *x)33{34 // CHECK: call i32 @_i_X__x35 [x x];36}37 38