1; RUN: opt < %s -instcombine -inline -S | FileCheck %s
2; PR3142
3
4; CHECK-NOT: -715827882
5
6define i32 @a(i32 %X) nounwind readnone {
7entry:
8       %0 = sub i32 0, %X
9       %1 = sdiv i32 %0, -3
10       ret i32 %1
11}
12
13define i32 @b(i32 %X) nounwind readnone {
14entry:
15       %0 = call i32 @a(i32 -2147483648)
16       ret i32 %0
17}
18
19define i32 @c(i32 %X) nounwind readnone {
20entry:
21       %0 = sub i32 0, -2147483648
22       %1 = sdiv i32 %0, -3
23       ret i32 %1
24}
25