blob: 9c6f68b343190f4ce34c638cb7a80b5a05c0c5ba [file] [log] [blame]
Jim Grosbach25e6d482011-07-08 21:50:04 +00001; RUN: llc < %s -ifcvt-limit=0 -mtriple=thumbv7-apple-darwin -mattr=+thumb2 | FileCheck %s
2; If-conversion defeats the purpose of this test, which is to check conditional
3; branch generation, so turn it off.
Evan Cheng31b99dd2009-08-14 18:31:44 +00004
Dan Gohman30fc5bb2010-05-03 14:35:47 +00005define i32 @f1(i32 %a, i32 %b, i32* %v) {
Evan Cheng31b99dd2009-08-14 18:31:44 +00006entry:
7; CHECK: f1:
Benjamin Kramer823bdbc2009-10-31 19:22:24 +00008; CHECK: bne LBB
Evan Cheng31b99dd2009-08-14 18:31:44 +00009 %tmp = icmp eq i32 %a, %b ; <i1> [#uses=1]
10 br i1 %tmp, label %cond_true, label %return
11
12cond_true: ; preds = %entry
13 store i32 0, i32* %v
Dan Gohman30fc5bb2010-05-03 14:35:47 +000014 ret i32 0
Evan Cheng31b99dd2009-08-14 18:31:44 +000015
16return: ; preds = %entry
Dan Gohman30fc5bb2010-05-03 14:35:47 +000017 ret i32 1
Evan Cheng31b99dd2009-08-14 18:31:44 +000018}
19
Dan Gohman30fc5bb2010-05-03 14:35:47 +000020define i32 @f2(i32 %a, i32 %b, i32* %v) {
Evan Cheng31b99dd2009-08-14 18:31:44 +000021entry:
22; CHECK: f2:
Benjamin Kramer823bdbc2009-10-31 19:22:24 +000023; CHECK: bge LBB
Evan Cheng31b99dd2009-08-14 18:31:44 +000024 %tmp = icmp slt i32 %a, %b ; <i1> [#uses=1]
25 br i1 %tmp, label %cond_true, label %return
26
27cond_true: ; preds = %entry
28 store i32 0, i32* %v
Dan Gohman30fc5bb2010-05-03 14:35:47 +000029 ret i32 0
Evan Cheng31b99dd2009-08-14 18:31:44 +000030
31return: ; preds = %entry
Dan Gohman30fc5bb2010-05-03 14:35:47 +000032 ret i32 1
Evan Cheng31b99dd2009-08-14 18:31:44 +000033}
34
Dan Gohman30fc5bb2010-05-03 14:35:47 +000035define i32 @f3(i32 %a, i32 %b, i32* %v) {
Evan Cheng31b99dd2009-08-14 18:31:44 +000036entry:
37; CHECK: f3:
Benjamin Kramer823bdbc2009-10-31 19:22:24 +000038; CHECK: bhs LBB
Evan Cheng31b99dd2009-08-14 18:31:44 +000039 %tmp = icmp ult i32 %a, %b ; <i1> [#uses=1]
40 br i1 %tmp, label %cond_true, label %return
41
42cond_true: ; preds = %entry
43 store i32 0, i32* %v
Dan Gohman30fc5bb2010-05-03 14:35:47 +000044 ret i32 0
Evan Cheng31b99dd2009-08-14 18:31:44 +000045
46return: ; preds = %entry
Dan Gohman30fc5bb2010-05-03 14:35:47 +000047 ret i32 1
Evan Cheng31b99dd2009-08-14 18:31:44 +000048}
49
Dan Gohman30fc5bb2010-05-03 14:35:47 +000050define i32 @f4(i32 %a, i32 %b, i32* %v) {
Evan Cheng31b99dd2009-08-14 18:31:44 +000051entry:
52; CHECK: f4:
Benjamin Kramer823bdbc2009-10-31 19:22:24 +000053; CHECK: blo LBB
Evan Cheng31b99dd2009-08-14 18:31:44 +000054 %tmp = icmp ult i32 %a, %b ; <i1> [#uses=1]
55 br i1 %tmp, label %return, label %cond_true
56
57cond_true: ; preds = %entry
58 store i32 0, i32* %v
Dan Gohman30fc5bb2010-05-03 14:35:47 +000059 ret i32 0
Evan Cheng31b99dd2009-08-14 18:31:44 +000060
61return: ; preds = %entry
Dan Gohman30fc5bb2010-05-03 14:35:47 +000062 ret i32 1
Evan Cheng31b99dd2009-08-14 18:31:44 +000063}