blob: 81bdb950e9fcbdb9570d3c57373f821ee0ca97b7 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; Ensure constant propogation of logical instructions is working correctly.
2
Tanya Lattner4c4d0b82008-03-01 09:15:35 +00003; RUN: llvm-as < %s | opt -constprop -die | llvm-dis | \
Dan Gohmanf17a25c2007-07-18 16:29:46 +00004; RUN: not egrep {and|or|xor}
5
Tanya Lattner4c4d0b82008-03-01 09:15:35 +00006define i32 @test1() {
7 %R = and i32 4, 1234 ; <i32> [#uses=1]
8 ret i32 %R
9}
Dan Gohmanf17a25c2007-07-18 16:29:46 +000010
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000011define i1 @test1.upgrd.1() {
12 %R = and i1 true, false ; <i1> [#uses=1]
13 ret i1 %R
14}
Dan Gohmanf17a25c2007-07-18 16:29:46 +000015
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000016define i32 @test2() {
17 %R = or i32 4, 1234 ; <i32> [#uses=1]
18 ret i32 %R
19}
Dan Gohmanf17a25c2007-07-18 16:29:46 +000020
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000021define i1 @test2.upgrd.2() {
22 %R = or i1 true, false ; <i1> [#uses=1]
23 ret i1 %R
24}
25
26define i32 @test3() {
27 %R = xor i32 4, 1234 ; <i32> [#uses=1]
28 ret i32 %R
29}
30
31define i1 @test3.upgrd.3() {
32 %R = xor i1 true, false ; <i1> [#uses=1]
33 ret i1 %R
34}
35