blob: 53daa8292da7b5e2e0532bab43526bd4985df124 [file] [log] [blame]
Igor Laevsky965bf6a2015-06-10 13:24:00 +00001; 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
5declare i64 addrspace(1)* @gc_call()
Chen Lid71999e2015-12-26 07:54:32 +00006declare token @llvm.experimental.gc.statepoint.p0f_p1i64f(i64, i32, i64 addrspace(1)* ()*, i32, i32, ...)
Igor Laevsky965bf6a2015-06-10 13:24:00 +00007declare i32* @fake_personality_function()
8
David Majnemer7fddecc2015-06-17 20:52:32 +00009define i32 @test() gc "statepoint-example" personality i32* ()* @fake_personality_function {
Igor Laevsky965bf6a2015-06-10 13:24:00 +000010; CHECK-LABEL: test
11entry:
12 ; CHECK-LABEL: entry:
Chen Lid71999e2015-12-26 07:54:32 +000013 ; CHECK-NEXT: %sp = invoke token (i64, i32, i64 addrspace(1)* ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_p1i64f
14 %sp = invoke token (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)
Igor Laevsky965bf6a2015-06-10 13:24:00 +000015 to label %normal unwind label %exception
16
17exception:
David Majnemer7fddecc2015-06-17 20:52:32 +000018 %lpad = landingpad { i8*, i32 }
Igor Laevsky965bf6a2015-06-10 13:24:00 +000019 cleanup
20 ret i32 0
21
22normal:
23 ret i32 1
24}