1 ; RUN: llc < %s -mtriple=thumb-apple-darwin -verify-machineinstrs | FileCheck %s
2 ; RUN: llc < %s -mtriple=thumb-pc-linux-gnueabi -verify-machineinstrs | FileCheck -check-prefix=CHECK-EABI %s
4 define i32 @f1(i32 %a.s) {
6 %tmp = icmp eq i32 %a.s, 4
7 %tmp1.s = select i1 %tmp, i32 2, i32 3
12 ; CHECK-EABI-LABEL: f1:
15 define i32 @f2(i32 %a.s) {
17 %tmp = icmp sgt i32 %a.s, 4
18 %tmp1.s = select i1 %tmp, i32 2, i32 3
23 ; CHECK-EABI-LABEL: f2:
26 define i32 @f3(i32 %a.s, i32 %b.s) {
28 %tmp = icmp slt i32 %a.s, %b.s
29 %tmp1.s = select i1 %tmp, i32 2, i32 3
34 ; CHECK-EABI-LABEL: f3:
37 define i32 @f4(i32 %a.s, i32 %b.s) {
39 %tmp = icmp sle i32 %a.s, %b.s
40 %tmp1.s = select i1 %tmp, i32 2, i32 3
45 ; CHECK-EABI-LABEL: f4:
48 define i32 @f5(i32 %a.u, i32 %b.u) {
50 %tmp = icmp ule i32 %a.u, %b.u
51 %tmp1.s = select i1 %tmp, i32 2, i32 3
56 ; CHECK-EABI-LABEL: f5:
59 define i32 @f6(i32 %a.u, i32 %b.u) {
61 %tmp = icmp ugt i32 %a.u, %b.u
62 %tmp1.s = select i1 %tmp, i32 2, i32 3
67 ; CHECK-EABI-LABEL: f6:
70 define double @f7(double %a, double %b) {
71 %tmp = fcmp olt double %a, 1.234e+00
72 %tmp1 = select i1 %tmp, double -1.000e+00, double %b
79 ; CHECK-EABI-LABEL: f7:
80 ; CHECK-EABI: __aeabi_dcmplt
81 ; CHECK-EABI: {{bne|beq}}
82 ; CHECK-EABI: {{bne|beq}}
84 define {i32, i32} @f8(i32 %a, i32 %b, i32 %c, i32 %d) {
86 %cmp = icmp slt i32 %a, %b
87 %r1 = select i1 %cmp, i32 %c, i32 %a
88 %r2 = select i1 %cmp, i32 %d, i32 %b
89 %z = insertvalue { i32, i32 } undef, i32 %r1, 0
90 %z2 = insertvalue { i32, i32 } %z, i32 %r2, 1