[FastISel] Undo phi node updates when falling-back to SelectionDAG.
[oota-llvm.git] / test / CodeGen / AArch64 / fast-isel-switch-phi.ll
1 ; RUN: llc -mtriple=aarch64-apple-darwin -fast-isel -verify-machineinstrs < %s
2 ; REQUIRES: asserts
3
4 ; Test that the Machine Instruction PHI node doesn't have more than one operand
5 ; from the same predecessor.
6 define i32 @foo(i32 %a, i32 %b, i1 %c) {
7 entry:
8   br i1 %c, label %switch, label %direct
9
10 switch:
11   switch i32 %a, label %exit [
12     i32 43, label %continue
13     i32 45, label %continue
14   ]
15
16 direct:
17   %var = add i32 %b, 1
18   br label %continue
19
20 continue:
21   %var.phi = phi i32 [ %var, %direct ], [ 0, %switch ], [ 0, %switch ]
22   ret i32 %var.phi
23
24 exit:
25   ret i32 1
26 }