1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-arc -fobjc-dispatch-method=mixed -o - %s | FileCheck %s 2 // rdar://10444476 3 4 @interface NSObject 5 - (id) new; 6 @end 7 8 @interface MyObject : NSObject 9 - (char)isEqual:(id) __attribute__((ns_consumed)) object; 10 @end 11 12 MyObject *x; 13 14 void foo() 15 { 16 id obj = [NSObject new]; 17 [x isEqual : obj]; 18 } 19 20 // CHECK: [[TMP:%.*]] = alloca i8 21 // CHECK: [[FIVE:%.*]] = call i8* @objc_retain 22 // CHECK-NEXT: [[SIX:%.*]] = bitcast 23 // CHECK-NEXT: [[SEVEN:%.*]] = icmp eq i8* [[SIX]], null 24 // CHECK-NEXT: br i1 [[SEVEN]], label [[NULLINIT:%.*]], label [[CALL_LABEL:%.*]] 25 // CHECK: [[FN:%.*]] = load i8** getelementptr inbounds 26 // CHECK-NEXT: [[EIGHT:%.*]] = bitcast i8* [[FN]] 27 // CHECK-NEXT: [[CALL:%.*]] = call signext i8 [[EIGHT]] 28 // CHECK-NEXT store i8 [[CALL]], i8* [[TMP]] 29 // CHECK-NEXT br label [[CONT:%.*]] 30 // CHECK: call void @objc_release(i8* [[FIVE]]) nounwind 31 // CHECK-NEXT: call void @llvm.memset 32 // CHECK-NEXT br label [[CONT]] 33