[Reassociate] Canonicalize negative constants out of expressions.
[oota-llvm.git] / test / Transforms / Reassociate / 2002-05-15-MissedTree.ll
1 ; RUN: opt < %s -reassociate -instcombine -S | FileCheck %s
2
3 define i32 @test1(i32 %A, i32 %B) {
4 ; CHECK-LABEL: test1
5 ; CHECK: %Z = add i32 %B, %A
6 ; CHECK: ret i32 %Z
7         %W = add i32 %B, -5
8         %Y = add i32 %A, 5
9         %Z = add i32 %W, %Y
10         ret i32 %Z
11 }