llvm.org GIT mirror llvm / f06c3c2
upgrade and simplify this test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47240 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 11 years ago
1 changed file(s) with 7 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
0 ; With sub reassociation, constant folding can eliminate the 12 and -12 constants.
11 ;
2 ; RUN: llvm-upgrade < %s | llvm-as | opt -reassociate -constprop -instcombine -die | llvm-dis | not grep 12
2 ; RUN: llvm-as < %s | opt -reassociate -instcombine | llvm-dis | not grep 12
33
4 int "test"(int %A, int %B) {
5 %X = add int -12, %A
6 %Y = sub int %X, %B
7 %Z = add int %Y, 12
8 ret int %Z
4 define i32 @test(i32 %A, i32 %B) {
5 %X = add i32 -12, %A ; [#uses=1]
6 %Y = sub i32 %X, %B ; [#uses=1]
7 %Z = add i32 %Y, 12 ; [#uses=1]
8 ret i32 %Z
99 }
10