ConstantFold: Shifting undef by zero results in undef

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224553 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Majnemer
2014-12-18 23:54:43 +00:00
parent a9dd3713d0
commit 73059bd1f1
2 changed files with 30 additions and 0 deletions

View File

@ -244,3 +244,24 @@ define i32 @test31(i32 %a) {
%b = shl i32 undef, %a
ret i32 %b
}
; CHECK-LABEL: @test32
; CHECK: ret i32 undef
define i32 @test32(i32 %a) {
%b = shl i32 undef, 0
ret i32 %b
}
; CHECK-LABEL: @test33
; CHECK: ret i32 undef
define i32 @test33(i32 %a) {
%b = ashr i32 undef, 0
ret i32 %b
}
; CHECK-LABEL: @test34
; CHECK: ret i32 undef
define i32 @test34(i32 %a) {
%b = lshr i32 undef, 0
ret i32 %b
}