This change is to fix rdar://12571717 which is about assertion in Reassociate pass.
[oota-llvm.git] / test / Transforms / Reassociate / mul_neg.ll
1 ; RUN: opt -S -reassociate < %s | FileCheck %s
2
3 ; t=-a; retval = t*7|t => t-a; retval => a*-7|t
4 define i32 @mulneg(i32 %a) nounwind uwtable ssp {
5 entry:
6   %sub = sub nsw i32 0, %a
7   %tmp1 = mul i32 %sub, 7
8   %tmp2 = xor i32 %sub, %tmp1
9   ret i32 %tmp2
10 ; CHECK: entry
11 ; CHECK: %tmp1 = mul i32 %a, -7 
12 ; CHECK: ret
13 }