Home | History | Annotate | Download | only in ARM
      1 ; RUN: llc < %s -mtriple=thumbv7-apple-darwin10 | FileCheck %s
      2 
      3 ; CHECK: _f
      4 ; CHECK: adds
      5 ; CHECK-NOT: cmp
      6 ; CHECK: blxeq _h
      7 
      8 define i32 @f(i32 %a, i32 %b) nounwind ssp {
      9 entry:
     10   %add = add nsw i32 %b, %a
     11   %cmp = icmp eq i32 %add, 0
     12   br i1 %cmp, label %if.then, label %if.end
     13 
     14 if.then:                                          ; preds = %entry
     15   tail call void (...)* @h(i32 %a, i32 %b) nounwind
     16   br label %if.end
     17 
     18 if.end:                                           ; preds = %if.then, %entry
     19   ret i32 %add
     20 }
     21 
     22 ; CHECK: _g
     23 ; CHECK: orrs
     24 ; CHECK-NOT: cmp
     25 ; CHECK: blxeq _h
     26 
     27 define i32 @g(i32 %a, i32 %b) nounwind ssp {
     28 entry:
     29   %add = or i32 %b, %a
     30   %cmp = icmp eq i32 %add, 0
     31   br i1 %cmp, label %if.then, label %if.end
     32 
     33 if.then:                                          ; preds = %entry
     34   tail call void (...)* @h(i32 %a, i32 %b) nounwind
     35   br label %if.end
     36 
     37 if.end:                                           ; preds = %if.then, %entry
     38   ret i32 %add
     39 }
     40 
     41 declare void @h(...)
     42