1 ; RUN: opt < %s -sccp -S | FileCheck %s
3 ; Test that SCCP has basic knowledge of when div can nuke overdefined values.
5 ; 0 / X = 0 even if X is overdefined.
7 ; CHECK-NEXT: ret i32 0
8 define i32 @test1(i32 %foo) {
9 %tinkywinky = udiv i32 0, %foo
14 ; CHECK-NEXT: ret i32 0
15 define i32 @test2(i32 %foo) {
16 %tinkywinky = sdiv i32 0, %foo
21 ; CHECK: ret i32 %tinkywinky
22 define i32 @test3(i32 %foo) {
23 %tinkywinky = udiv i32 %foo, 0
28 ; CHECK: ret i32 %tinkywinky
29 define i32 @test4(i32 %foo) {
30 %tinkywinky = sdiv i32 %foo, 0