blob: 898c09b82f5e2e8a0325be2b90c93cc5d59280d3 [file] [log] [blame]
Dan Gohman0a063102009-09-08 23:54:48 +00001; RUN: llc < %s -march=x86 | grep cmp | count 1
2; RUN: llc < %s -march=x86 | grep test | count 1
Dan Gohmanf17a25c2007-07-18 16:29:46 +00003
Tanya Lattner632e88a2008-02-21 07:42:26 +00004define i32 @f1(i32 %X, i32* %y) {
5 %tmp = load i32* %y ; <i32> [#uses=1]
6 %tmp.upgrd.1 = icmp eq i32 %tmp, 0 ; <i1> [#uses=1]
7 br i1 %tmp.upgrd.1, label %ReturnBlock, label %cond_true
Dan Gohmanf17a25c2007-07-18 16:29:46 +00008
Tanya Lattner632e88a2008-02-21 07:42:26 +00009cond_true: ; preds = %0
10 ret i32 1
Dan Gohmanf17a25c2007-07-18 16:29:46 +000011
Tanya Lattner632e88a2008-02-21 07:42:26 +000012ReturnBlock: ; preds = %0
13 ret i32 0
Dan Gohmanf17a25c2007-07-18 16:29:46 +000014}
15
Tanya Lattner632e88a2008-02-21 07:42:26 +000016define i32 @f2(i32 %X, i32* %y) {
17 %tmp = load i32* %y ; <i32> [#uses=1]
18 %tmp1 = shl i32 %tmp, 3 ; <i32> [#uses=1]
19 %tmp1.upgrd.2 = icmp eq i32 %tmp1, 0 ; <i1> [#uses=1]
20 br i1 %tmp1.upgrd.2, label %ReturnBlock, label %cond_true
Dan Gohmanf17a25c2007-07-18 16:29:46 +000021
Tanya Lattner632e88a2008-02-21 07:42:26 +000022cond_true: ; preds = %0
23 ret i32 1
Dan Gohmanf17a25c2007-07-18 16:29:46 +000024
Tanya Lattner632e88a2008-02-21 07:42:26 +000025ReturnBlock: ; preds = %0
26 ret i32 0
Dan Gohmanf17a25c2007-07-18 16:29:46 +000027}