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