1 ; RUN: opt -S -rewrite-statepoints-for-gc < %s | FileCheck %s
3 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128-ni:1"
4 target triple = "x86_64-unknown-linux-gnu"
7 declare void @g(i8 addrspace(1)*, i8 addrspace(1)*)
8 declare i32 @personality_function()
10 ; Make sure that we do not fail assertion because we process call of @g before
11 ; we process the call of @f.
13 define void @test_01(i8 addrspace(1)* %p, i1 %cond) gc "statepoint-example" personality i32 ()* @personality_function {
15 ; CHECK-LABEL: @test_01(
18 %tmp0 = insertelement <2 x i8 addrspace(1)*> poison, i8 addrspace(1)* %p, i32 0
19 %tmp1 = insertelement <2 x i8 addrspace(1)*> %tmp0, i8 addrspace(1)* %p, i32 1
20 %tmp2 = extractelement <2 x i8 addrspace(1)*> %tmp1, i32 1
21 %tmp3 = extractelement <2 x i8 addrspace(1)*> %tmp1, i32 0
25 br i1 %cond, label %cond_block, label %exit
28 br i1 %cond, label %backedge, label %exit
31 %tmp4 = phi i8 addrspace(1)* [ %tmp2, %loop ], [ %tmp2, %cond_block ]
32 call void @g(i8 addrspace(1)* %tmp3, i8 addrspace(1)* %tmp4)