blob: 63814ba9f21071d2407af245c8b88a55d8d3900e [file] [log] [blame]
Sanjoy Das04071082016-01-29 00:28:57 +00001; RUN: opt -S -rewrite-statepoints-for-gc < %s | FileCheck %s
Fedor Sergeev4b86d792017-12-15 09:32:11 +00002; RUN: opt -S -passes=rewrite-statepoints-for-gc < %s | FileCheck %s
Sanjoy Das58fae7c2015-10-16 02:41:23 +00003
4declare void @f()
5declare i32 @personality_function()
6
7define void @test_id() gc "statepoint-example" personality i32 ()* @personality_function {
8; CHECK-LABEL: @test_id(
9entry:
10; CHECK-LABEL: entry:
Chen Lid71999e2015-12-26 07:54:32 +000011; CHECK: invoke token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 100, i32 0, void ()* @f
Sanjoy Das58fae7c2015-10-16 02:41:23 +000012 invoke void @f() "statepoint-id"="100" to label %normal_return unwind label %exceptional_return
13
14normal_return:
15 ret void
16
17exceptional_return:
18 %landing_pad4 = landingpad {i8*, i32} cleanup
19 ret void
20}
21
22define void @test_num_patch_bytes() gc "statepoint-example" personality i32 ()* @personality_function {
23; CHECK-LABEL: @test_num_patch_bytes(
24entry:
25; CHECK-LABEL: entry:
Chen Lid71999e2015-12-26 07:54:32 +000026; CHECK: invoke token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 2882400000, i32 99, void ()* @f,
Sanjoy Das58fae7c2015-10-16 02:41:23 +000027 invoke void @f() "statepoint-num-patch-bytes"="99" to label %normal_return unwind label %exceptional_return
28
29normal_return:
30 ret void
31
32exceptional_return:
33 %landing_pad4 = landingpad {i8*, i32} cleanup
34 ret void
35}
36
37declare void @do_safepoint()
38define void @gc.safepoint_poll() {
39entry:
40 call void @do_safepoint()
41 ret void
42}
43
44; CHECK-NOT: statepoint-id
45; CHECK-NOT: statepoint-num-patch_bytes