OSDN Git Service

Update aosp/master LLVM for rebase to r256229
[android-x86/external-llvm.git] / test / Transforms / SimplifyCFG / statepoint-invoke-unwind.ll
1 ; RUN: opt < %s -simplifycfg -S | FileCheck %s
2 ; Test that statepoint intrinsic is marked with Throwable attribute and it is
3 ; not optimized into call
4
5 declare i64 addrspace(1)* @gc_call()
6 declare i32 @llvm.experimental.gc.statepoint.p0f_p1i64f(i64, i32, i64 addrspace(1)* ()*, i32, i32, ...)
7 declare i32* @fake_personality_function()
8
9 define i32 @test() gc "statepoint-example" personality i32* ()* @fake_personality_function {
10 ; CHECK-LABEL: test
11 entry:
12   ; CHECK-LABEL: entry:
13   ; CHECK-NEXT: %sp = invoke i32 (i64, i32, i64 addrspace(1)* ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_p1i64f
14   %sp = invoke i32 (i64, i32, i64 addrspace(1)* ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_p1i64f(i64 0, i32 0, i64 addrspace(1)* ()* @gc_call, i32 0, i32 0, i32 0, i32 0)
15                 to label %normal unwind label %exception
16
17 exception:
18   %lpad = landingpad { i8*, i32 }
19           cleanup
20   ret i32 0
21
22 normal:
23   ret i32 1
24 }