blob: 7d55cd178261f2c8924eb2383dac3811adb95a0a [file] [log] [blame]
Chris Lattner48b03bc2010-10-08 05:02:29 +00001; RUN: llc < %s -march=x86-64 | FileCheck %s
Evan Cheng23f84972006-09-11 02:33:29 +00002
Chris Lattner48b03bc2010-10-08 05:02:29 +00003define i32 @test1(i32 %X, i32* %y) nounwind {
Tanya Lattner33eefff2008-02-21 07:42:26 +00004 %tmp = load i32* %y ; <i32> [#uses=1]
5 %tmp.upgrd.1 = icmp eq i32 %tmp, 0 ; <i1> [#uses=1]
6 br i1 %tmp.upgrd.1, label %ReturnBlock, label %cond_true
Evan Cheng23f84972006-09-11 02:33:29 +00007
Tanya Lattner33eefff2008-02-21 07:42:26 +00008cond_true: ; preds = %0
9 ret i32 1
Evan Cheng23f84972006-09-11 02:33:29 +000010
Tanya Lattner33eefff2008-02-21 07:42:26 +000011ReturnBlock: ; preds = %0
12 ret i32 0
Chris Lattner48b03bc2010-10-08 05:02:29 +000013; CHECK: test1:
14; CHECK: cmpl $0, (%rsi)
Evan Cheng23f84972006-09-11 02:33:29 +000015}
16
Chris Lattner48b03bc2010-10-08 05:02:29 +000017define i32 @test2(i32 %X, i32* %y) nounwind {
Tanya Lattner33eefff2008-02-21 07:42:26 +000018 %tmp = load i32* %y ; <i32> [#uses=1]
19 %tmp1 = shl i32 %tmp, 3 ; <i32> [#uses=1]
20 %tmp1.upgrd.2 = icmp eq i32 %tmp1, 0 ; <i1> [#uses=1]
21 br i1 %tmp1.upgrd.2, label %ReturnBlock, label %cond_true
Evan Cheng23f84972006-09-11 02:33:29 +000022
Tanya Lattner33eefff2008-02-21 07:42:26 +000023cond_true: ; preds = %0
24 ret i32 1
Evan Cheng23f84972006-09-11 02:33:29 +000025
Tanya Lattner33eefff2008-02-21 07:42:26 +000026ReturnBlock: ; preds = %0
27 ret i32 0
Chris Lattner48b03bc2010-10-08 05:02:29 +000028; CHECK: test2:
29; CHECK: movl (%rsi), %eax
30; CHECK: shll $3, %eax
31; CHECK: testl %eax, %eax
Evan Cheng23f84972006-09-11 02:33:29 +000032}