Reassociate: cannot negate a INT_MIN value
[oota-llvm.git] / test / Transforms / Reassociate / min_int.ll
1 ; RUN: opt < %s -reassociate -dce -S | FileCheck %s
2
3 ; MIN_INT cannot be negated during reassociation
4
5 define i32 @minint(i32 %i) {
6 ; CHECK:  %mul = mul i32 %i, -2147483648
7 ; CHECK-NEXT:  %add = add i32 %mul, 1
8 ; CHECK-NEXT:  ret i32 %add
9   %mul = mul i32 %i, -2147483648
10   %add = add i32 %mul, 1
11   ret i32 %add
12 }
13