comparison test/Transforms/ObjCARC/contract-storestrong-funclet.ll @ 147:c2174574ed3a

LLVM 10
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Wed, 14 Aug 2019 16:55:33 +0900
parents
children
comparison
equal deleted inserted replaced
134:3a76565eade5 147:c2174574ed3a
1 ; RUN: opt -mtriple=i686-unknown-windows-msvc -objc-arc-contract -S -o - %s | FileCheck %s
2
3 declare void @f()
4 declare i32 @__CxxFrameHandler3(...)
5 declare dllimport i8* @llvm.objc.retain(i8*)
6 declare dllimport i8* @llvm.objc.retainAutoreleasedReturnValue(i8*)
7 declare dllimport void @llvm.objc.release(i8*)
8
9 @x = external global i8*
10
11 define void @g(i8* %p) personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
12 invoke void @f() to label %invoke.cont unwind label %ehcleanup
13
14 invoke.cont:
15 %call = tail call i8* @llvm.objc.retain(i8* %p) nounwind
16 %tmp = load i8*, i8** @x, align 4
17 store i8* %call, i8** @x, align 4
18 tail call void @llvm.objc.release(i8* %tmp) nounwind
19 ret void
20
21 ehcleanup:
22 %1 = cleanuppad within none []
23 %call1 = tail call i8* @llvm.objc.retain(i8* %p) nounwind [ "funclet"(token %1) ]
24 %tmp1 = load i8*, i8** @x, align 4
25 store i8* %call1, i8** @x, align 4
26 tail call void @llvm.objc.release(i8* %tmp1) nounwind [ "funclet"(token %1) ]
27 cleanupret from %1 unwind to caller
28 }
29
30 ; CHECK-LABEL: invoke.cont:
31 ; CHECK: tail call void @llvm.objc.storeStrong(i8** @x, i8* %p) #0{{$}}
32 ; CHECK: ret void
33
34 ; CHECK-LABEL: ehcleanup:
35 ; CHECK: %1 = cleanuppad within none []
36 ; CHECK: tail call void @llvm.objc.storeStrong(i8** @x, i8* %p) #0 [ "funclet"(token %1) ]
37 ; CHECK: cleanupret from %1 unwind to caller