brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · 07e6770 Raw
42 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -passes=rewrite-statepoints-for-gc -S < %s | FileCheck %s3; Check that the "deopt-lowering" function attribute gets transcoded into4; flags on the resulting statepoint5 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-NEXT:  entry:16; CHECK-NEXT:    [[STATEPOINT_TOKEN:%.*]] = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 2882400000, i32 0, ptr elementtype(void ()) @foo, i32 0, i32 0, i32 0, i32 0) [ "deopt"(i32 57) ]17; CHECK-NEXT:    [[STATEPOINT_TOKEN1:%.*]] = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 2882400000, i32 0, ptr elementtype(void ()) @bar, i32 0, i32 2, i32 0, i32 0) [ "deopt"(i32 42) ]18; CHECK-NEXT:    [[STATEPOINT_TOKEN2:%.*]] = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 2882400000, i32 0, ptr elementtype(void ()) @baz, i32 0, i32 0, i32 0, i32 0) [ "deopt"(i32 13) ]19; CHECK-NEXT:    ret void20;21 22entry:23  call void @foo() [ "deopt"(i32 57) ]24  call void @bar() [ "deopt"(i32 42) ]25  call void @baz() [ "deopt"(i32 13) ]26  ret void27}28 29; add deopt-lowering attribute as part of callsite30define void @test2() gc "statepoint-example" {31; CHECK-LABEL: @test2(32; CHECK-NEXT:  entry:33; CHECK-NEXT:    [[STATEPOINT_TOKEN:%.*]] = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 2882400000, i32 0, ptr elementtype(void ()) @foo, i32 0, i32 2, i32 0, i32 0) #[[ATTR0:[0-9]+]] [ "deopt"(i32 57) ]34; CHECK-NEXT:    ret void35;36 37entry:38  call void @foo()  "deopt-lowering"="live-in"  [ "deopt"(i32 57) ]39  ret void40}41 42