xref: /minix3/external/bsd/llvm/dist/llvm/test/Transforms/LoopUnswitch/2011-06-02-CritSwitch.ll (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1; RUN: opt -loop-unswitch -disable-output < %s
2; PR10031
3
4define i32 @test(i32 %command) {
5entry:
6  br label %tailrecurse
7
8tailrecurse:                                      ; preds = %if.then14, %tailrecurse, %entry
9  br i1 undef, label %if.then, label %tailrecurse
10
11if.then:                                          ; preds = %tailrecurse
12  switch i32 %command, label %sw.bb [
13    i32 2, label %land.lhs.true
14    i32 0, label %land.lhs.true
15  ]
16
17land.lhs.true:                                    ; preds = %if.then, %if.then
18  br i1 undef, label %sw.bb, label %if.then14
19
20if.then14:                                        ; preds = %land.lhs.true
21  switch i32 %command, label %tailrecurse [
22    i32 0, label %sw.bb
23    i32 1, label %sw.bb
24  ]
25
26sw.bb:                                            ; preds = %if.then14
27  unreachable
28}
29