blob: d0a331905088fda0bfc24d73d8904cb9cee4d3a7 [file] [log] [blame]
Philip Reames2b1084a2016-08-31 15:12:17 +00001; RUN: opt -rewrite-statepoints-for-gc -S < %s | FileCheck %s
Fedor Sergeev4b86d792017-12-15 09:32:11 +00002; RUN: opt -passes=rewrite-statepoints-for-gc -S < %s | FileCheck %s
Philip Reames2b1084a2016-08-31 15:12:17 +00003; Check that the "deopt-lowering" function attribute gets transcoded into
4; flags on the resulting statepoint
5
6target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
7target triple = "x86_64-apple-macosx10.11.0"
8
9declare void @foo()
10declare void @bar() "deopt-lowering"="live-in"
11declare void @baz() "deopt-lowering"="live-through"
12
13define void @test1() gc "statepoint-example" {
14; CHECK-LABEL: @test1(
15; CHECK: @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 2882400000, i32 0, void ()* @foo, i32 0, i32 0, i32 0, i32 1, i32 57)
16; CHECK: @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 2882400000, i32 0, void ()* @bar, i32 0, i32 2, i32 0, i32 1, i32 42)
17; CHECK: @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 2882400000, i32 0, void ()* @baz, i32 0, i32 0, i32 0, i32 1, i32 13)
18
19entry:
20 call void @foo() [ "deopt"(i32 57) ]
21 call void @bar() [ "deopt"(i32 42) ]
22 call void @baz() [ "deopt"(i32 13) ]
23 ret void
24}
Anna Thomase76d77a2016-10-07 20:34:00 +000025
26; add deopt-lowering attribute as part of callsite
27define void @test2() gc "statepoint-example" {
28; CHECK-LABEL: @test2(
29; CHECK: @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 2882400000, i32 0, void ()* @foo, i32 0, i32 2, i32 0, i32 1, i32 57)
30
31entry:
32 call void @foo() "deopt-lowering"="live-in" [ "deopt"(i32 57) ]
33 ret void
34}
35