blob: 13fb5ebc53056fcd8d98a240e072e1e1faab81ec [file] [log] [blame]
Dan Gohman25d2a0d2015-09-08 12:39:25 +00001; RUN: llc < %s -asm-verbose=false | FileCheck %s
2
Dan Gohmand4a12d22015-09-08 13:21:12 +00003; This test depends on branching support, which is not yet checked in.
4; XFAIL: *
5
Dan Gohman25d2a0d2015-09-08 12:39:25 +00006; Test that phis are lowered.
7
8target datalayout = "e-p:32:32-i64:64-v128:8:128-n32:64-S128"
9target triple = "wasm32-unknown-unknown"
10
11; CHECK-LABEL: test0
12; CHECK: (setlocal [[REG:@.*]] (argument 0))
13; CHECK: (setlocal [[REG]] (sdiv [[REG]] {{.*}}))
14; CHECK: (return [[REG]])
15define i32 @test0(i32 %p) {
16entry:
17 %t = icmp slt i32 %p, 0
18 br i1 %t, label %true, label %done
19true:
20 %a = sdiv i32 %p, 3
21 br label %done
22done:
23 %s = phi i32 [ %a, %true ], [ %p, %entry ]
24 ret i32 %s
25}