bc5bcc391ba30ddc4938f61fcdf4be850352d60d
[oota-llvm.git] / test / CodeGen / Mips / analyzebranch.ll
1 ; RUN: llc -march=mips < %s | FileCheck %s
2
3 define double @foo(double %a, double %b) nounwind readnone {
4 entry:
5 ; CHECK: bc1f $BB0_2
6 ; CHECK: nop
7 ; CHECK: # BB#1:    
8
9   %cmp = fcmp ogt double %a, 0.000000e+00
10   br i1 %cmp, label %if.end6, label %if.else
11
12 if.else:                                          ; preds = %entry
13   %cmp3 = fcmp ogt double %b, 0.000000e+00
14   br i1 %cmp3, label %if.end6, label %return
15
16 if.end6:                                          ; preds = %if.else, %entry
17   %c.0 = phi double [ %a, %entry ], [ 0.000000e+00, %if.else ]
18   %sub = fsub double %b, %c.0
19   %mul = fmul double %sub, 2.000000e+00
20   br label %return
21
22 return:                                           ; preds = %if.else, %if.end6
23   %retval.0 = phi double [ %mul, %if.end6 ], [ 0.000000e+00, %if.else ]
24   ret double %retval.0
25 }
26
27 define void @f1(float %f) nounwind {
28 entry:
29 ; CHECK: bc1f $BB1_1
30 ; CHECK: nop
31 ; CHECK: # BB#2:
32   %cmp = fcmp une float %f, 0.000000e+00
33   br i1 %cmp, label %if.then, label %if.end
34
35 if.then:                                          ; preds = %entry
36   tail call void @abort() noreturn
37   unreachable
38
39 if.end:                                           ; preds = %entry
40   tail call void (...)* @f2() nounwind
41   ret void
42 }
43
44 declare void @abort() noreturn nounwind
45
46 declare void @f2(...)