1 ; RUN: opt -mtriple=i686-unknown-windows-msvc -objc-arc-contract -S -o - %s | FileCheck %s
3 ; Generated (and lightly modified and cleaned up) from the following source:
13 ; CHECK-LABEL: define void @"\01?g@@YAXXZ"()
15 ; CHECK: call void asm sideeffect "movl{{.*}}%ebp, %ebp{{.*}}", ""() [ "funclet"(token %1) ]
17 ; CHECK-LABEL: catch.1
18 ; CHECK: call void asm sideeffect "movl{{.*}}%ebp, %ebp{{.*}}", ""() [ "funclet"(token %1) ]
20 ; CHECK-LABEL: invoke.cont
21 ; CHECK: call void asm sideeffect "movl{{.*}}%ebp, %ebp{{.*}}", ""(){{$}}
23 define void @"\01?g@@YAXXZ"() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
25 %call = invoke i8* @"\01?f@@YAPAUobjc_object@@XZ"()
26 to label %invoke.cont unwind label %catch.dispatch
28 catch.dispatch: ; preds = %entry
29 %0 = catchswitch within none [label %catch] unwind to caller
31 catch: ; preds = %catch.dispatch
32 %1 = catchpad within %0 [i8* null, i32 64, i8* null]
33 %call1 = call i8* @"\01?f@@YAPAUobjc_object@@XZ"() [ "funclet"(token %1) ]
34 %2 = call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* %call1) [ "funclet"(token %1) ]
35 call void @llvm.objc.release(i8* %2) [ "funclet"(token %1) ]
38 catch.1: ; preds = %catch
39 %call2 = call i8* @"\01?f@@YAPAUobjc_object@@XZ"() [ "funclet"(token %1) ]
40 %3 = call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* %call2) [ "funclet"(token %1) ]
41 call void @llvm.objc.release(i8* %3) [ "funclet"(token %1) ]
42 catchret from %1 to label %catchret.dest
44 catchret.dest: ; preds = %catch.1
47 invoke.cont: ; preds = %entry
48 %4 = call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* %call)
49 call void @llvm.objc.release(i8* %4)
53 ; CHECK-LABEL: define dso_local void @"?test_attr_claimRV@@YAXXZ"()
54 ; CHECK: %[[CALL4:.*]] = notail call i8* @"?noexcept_func@@YAPAUobjc_object@@XZ"() [ "clang.arc.attachedcall"(i64 1) ]
55 ; CHECK: call i8* @llvm.objc.unsafeClaimAutoreleasedReturnValue(i8* %[[CALL4]])
57 ; CHECK: %[[V1:.*]] = cleanuppad
58 ; CHECK: %[[CALL:.*]] = notail call i8* @"?noexcept_func@@YAPAUobjc_object@@XZ"() [ "funclet"(token %[[V1]]), "clang.arc.attachedcall"(i64 1) ]
59 ; CHECK: call i8* @llvm.objc.unsafeClaimAutoreleasedReturnValue(i8* %[[CALL]]) [ "funclet"(token %[[V1]]) ]
61 define dso_local void @"?test_attr_claimRV@@YAXXZ"() local_unnamed_addr #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
63 invoke void @"?foo@@YAXXZ"()
64 to label %invoke.cont unwind label %ehcleanup
66 invoke.cont: ; preds = %entry
67 %call.i4 = tail call i8* @"?noexcept_func@@YAPAUobjc_object@@XZ"() #2 [ "clang.arc.attachedcall"(i64 1) ]
70 ehcleanup: ; preds = %entry
71 %0 = cleanuppad within none []
72 %call.i = call i8* @"?noexcept_func@@YAPAUobjc_object@@XZ"() #2 [ "funclet"(token %0), "clang.arc.attachedcall"(i64 1) ]
73 cleanupret from %0 unwind to caller
76 declare i8* @"\01?f@@YAPAUobjc_object@@XZ"()
78 declare i32 @__CxxFrameHandler3(...)
80 declare void @"?foo@@YAXXZ"()
81 declare i8* @"?noexcept_func@@YAPAUobjc_object@@XZ"()
83 declare dllimport i8* @llvm.objc.retainAutoreleasedReturnValue(i8*)
84 declare i8* @llvm.objc.unsafeClaimAutoreleasedReturnValue(i8*)
86 declare dllimport void @llvm.objc.release(i8*)
88 !llvm.module.flags = !{!0}
90 !0 = !{i32 1, !"clang.arc.retainAutoreleasedReturnValueMarker", !"movl\09%ebp, %ebp\09\09// marker for objc_retainAutoreleaseReturnValue"}