1 ; RUN: opt -mtriple x86_64-unknown-windows-msvc -objc-arc -o - %s | llvm-dis -o - - | FileCheck %s
3 target triple = "x86_64-unknown-windows-msvc"
5 declare i32 @__CxxFrameHandler3(...)
7 declare dllimport i8* @llvm.objc.msgSend(i8*, i8*, ...) local_unnamed_addr
9 declare dllimport i8* @llvm.objc.retain(i8* returned) local_unnamed_addr
10 declare dllimport void @llvm.objc.release(i8*) local_unnamed_addr
11 declare dllimport i8* @llvm.objc.retainAutoreleasedReturnValue(i8* returned) local_unnamed_addr
13 declare dllimport i8* @llvm.objc.begin_catch(i8*) local_unnamed_addr
14 declare dllimport void @llvm.objc.end_catch() local_unnamed_addr
16 @llvm.objc.METH_VAR_NAME_ = private unnamed_addr constant [2 x i8] c"m\00", align 1
17 @llvm.objc.SELECTOR_REFERENCES_ = private externally_initialized global i8* getelementptr inbounds ([2 x i8], [2 x i8]* @llvm.objc.METH_VAR_NAME_, i64 0, i64 0), section ".objc_selrefs$B", align 8
19 define void @f(i8* %i) local_unnamed_addr personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
21 %0 = tail call i8* @llvm.objc.retain(i8* %i)
22 %1 = load i8*, i8** @llvm.objc.SELECTOR_REFERENCES_, align 8, !invariant.load !0
23 %call = invoke i8* bitcast (i8* (i8*, i8*, ...)* @llvm.objc.msgSend to i8* (i8*, i8*)*)(i8* %0, i8* %1)
24 to label %invoke.cont unwind label %catch.dispatch, !clang.arc.no_objc_arc_exceptions !0
26 catch.dispatch: ; preds = %entry
27 %2 = catchswitch within none [label %catch] unwind to caller
29 invoke.cont: ; preds = %entry
30 %3 = tail call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* %call)
31 tail call void @llvm.objc.release(i8* %3) #0, !clang.imprecise_release !0
34 eh.cont: ; preds = %invoke.cont, %catch
35 tail call void @llvm.objc.release(i8* %0) #0, !clang.imprecise_release !0
38 catch: ; preds = %catch.dispatch
39 %4 = catchpad within %2 [i8* null, i32 0, i8* null]
40 %exn.adjusted = tail call i8* @llvm.objc.begin_catch(i8* undef)
41 tail call void @llvm.objc.end_catch(), !clang.arc.no_objc_arc_exceptions !0
47 ; CHECK-NOT: tail call i8* @llvm.objc.retain(i8* %i)
48 ; CHECK: load i8*, i8** @llvm.objc.SELECTOR_REFERENCES_, align 8
51 ; CHECK-NOT: call void @llvm.objc.release(i8*
54 attributes #0 = { nounwind }