Home | History | Annotate | Download | only in ConstProp
      1 ; Ensure constant propagation of logical instructions is working correctly.
      2 
      3 ; RUN: opt < %s -constprop -die -S | FileCheck %s
      4 ; CHECK-NOT:     {{and|or|xor}}
      5 
      6 define i32 @test1() {
      7         %R = and i32 4, 1234            ; <i32> [#uses=1]
      8         ret i32 %R
      9 }
     10 
     11 define i1 @test1.upgrd.1() {
     12         %R = and i1 true, false         ; <i1> [#uses=1]
     13         ret i1 %R
     14 }
     15 
     16 define i32 @test2() {
     17         %R = or i32 4, 1234             ; <i32> [#uses=1]
     18         ret i32 %R
     19 }
     20 
     21 define i1 @test2.upgrd.2() {
     22         %R = or i1 true, false          ; <i1> [#uses=1]
     23         ret i1 %R
     24 }
     25 
     26 define i32 @test3() {
     27         %R = xor i32 4, 1234            ; <i32> [#uses=1]
     28         ret i32 %R
     29 }
     30 
     31 define i1 @test3.upgrd.3() {
     32         %R = xor i1 true, false         ; <i1> [#uses=1]
     33         ret i1 %R
     34 }
     35 
     36