1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -mtriple=i686-unknown-windows-msvc -passes=objc-arc-contract -S -o - %s | FileCheck %s
5 declare i32 @__CxxFrameHandler3(...)
6 declare dllimport ptr @llvm.objc.retain(ptr)
7 declare dllimport ptr @llvm.objc.retainAutoreleasedReturnValue(ptr)
8 declare dllimport void @llvm.objc.release(ptr)
10 @x = external global ptr
12 define void @g(ptr %p) personality ptr @__CxxFrameHandler3 {
14 ; CHECK-NEXT: invoke void @f()
15 ; CHECK-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[EHCLEANUP:%.*]]
17 ; CHECK-NEXT: tail call void @llvm.objc.storeStrong(ptr @x, ptr [[P:%.*]]) #[[ATTR0:[0-9]+]]
18 ; CHECK-NEXT: ret void
20 ; CHECK-NEXT: [[TMP1:%.*]] = cleanuppad within none []
21 ; CHECK-NEXT: tail call void @llvm.objc.storeStrong(ptr @x, ptr [[P]]) #[[ATTR0]] [ "funclet"(token [[TMP1]]) ]
22 ; CHECK-NEXT: cleanupret from [[TMP1]] unwind to caller
24 invoke void @f() to label %invoke.cont unwind label %ehcleanup
27 %call = tail call ptr @llvm.objc.retain(ptr %p) nounwind
28 %tmp = load ptr, ptr @x, align 4
29 store ptr %call, ptr @x, align 4
30 tail call void @llvm.objc.release(ptr %tmp) nounwind
34 %1 = cleanuppad within none []
35 %call1 = tail call ptr @llvm.objc.retain(ptr %p) nounwind [ "funclet"(token %1) ]
36 %tmp1 = load ptr, ptr @x, align 4
37 store ptr %call1, ptr @x, align 4
38 tail call void @llvm.objc.release(ptr %tmp1) nounwind [ "funclet"(token %1) ]
39 cleanupret from %1 unwind to caller