1*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=r600 -mcpu=redwood %s -o - | FileCheck %s 2*9880d681SAndroid Build Coastguard Worker 3*9880d681SAndroid Build Coastguard Worker; This tests for a bug where vertex fetch clauses right before an ENDIF 4*9880d681SAndroid Build Coastguard Worker; instruction where being emitted after the ENDIF. We were using ALU_POP_AFTER 5*9880d681SAndroid Build Coastguard Worker; for the ALU clause before the vetex fetch instead of emitting a POP instruction 6*9880d681SAndroid Build Coastguard Worker; after the fetch clause. 7*9880d681SAndroid Build Coastguard Worker 8*9880d681SAndroid Build Coastguard Worker 9*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: {{^}}test: 10*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: ALU_POP_AFTER 11*9880d681SAndroid Build Coastguard Worker; CHECK: TEX 12*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: POP 13*9880d681SAndroid Build Coastguard Workerdefine void @test(i32 addrspace(1)* %out, i32 addrspace(1)* %in, i32 %cond) { 14*9880d681SAndroid Build Coastguard Workerentry: 15*9880d681SAndroid Build Coastguard Worker %0 = icmp eq i32 %cond, 0 16*9880d681SAndroid Build Coastguard Worker br i1 %0, label %endif, label %if 17*9880d681SAndroid Build Coastguard Worker 18*9880d681SAndroid Build Coastguard Workerif: 19*9880d681SAndroid Build Coastguard Worker %1 = load i32, i32 addrspace(1)* %in 20*9880d681SAndroid Build Coastguard Worker br label %endif 21*9880d681SAndroid Build Coastguard Worker 22*9880d681SAndroid Build Coastguard Workerendif: 23*9880d681SAndroid Build Coastguard Worker %x = phi i32 [ %1, %if], [ 0, %entry] 24*9880d681SAndroid Build Coastguard Worker store i32 %x, i32 addrspace(1)* %out 25*9880d681SAndroid Build Coastguard Worker br label %done 26*9880d681SAndroid Build Coastguard Worker 27*9880d681SAndroid Build Coastguard Workerdone: 28*9880d681SAndroid Build Coastguard Worker ret void 29*9880d681SAndroid Build Coastguard Worker} 30