; RUN: llvm-as < %s | opt -instcombine -inline | llvm-dis | grep {715827882} | count 2
; PR3142

define i32 @a(i32 %X) nounwind readnone {
entry:
       %0 = sub i32 0, %X
       %1 = sdiv i32 %0, -3
       ret i32 %1
}

define i32 @b(i32 %X) nounwind readnone {
entry:
       %0 = call i32 @a(i32 -2147483648)
       ret i32 %0
}

define i32 @c(i32 %X) nounwind readnone {
entry:
       %0 = sub i32 0, -2147483648
       %1 = sdiv i32 %0, -3
       ret i32 %1
}

; RUN: llvm-as < %s | opt -instcombine -inline | llvm-dis | not grep '-715827882'
; PR3142

define i32 @a(i32 %X) nounwind readnone {
entry:
       %0 = sub i32 0, %X
       %1 = sdiv i32 %0, -3
       ret i32 %1
}

define i32 @b(i32 %X) nounwind readnone {
entry:
       %0 = call i32 @a(i32 -2147483648)
       ret i32 %0
}

define i32 @c(i32 %X) nounwind readnone {
entry:
       %0 = sub i32 0, -2147483648
       %1 = sdiv i32 %0, -3
       ret i32 %1
}

Strengthen check for div inst-combining.
Strengthen check for div inst-combining.

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@60276 91177308-0d34-0410-b5e6-96231b3b80d8
