ConstantFold: div undef, 0 should fold to undef, not zero

Dividing by zero yields an undefined value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223924 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Majnemer
2014-12-10 09:14:55 +00:00
parent 6578f1beb1
commit 895316336e
2 changed files with 26 additions and 9 deletions
+7
View File
@@ -188,3 +188,10 @@ define i32 @test23(i32 %a) {
%b = lshr exact i32 undef, %a
ret i32 %b
}
; CHECK-LABEL: @test24
; CHECK: ret i32 undef
define i32 @test24(i32 %a) {
%b = udiv i32 undef, 0
ret i32 %b
}