1 ; This test makes sure that add instructions are properly eliminated.
3 ; This also tests that a subtract with a constant is properly converted
4 ; to a add w/negative constant
6 ; RUN: if as < %s | opt -instcombine -dce | dis | grep add
29 %C = sub int %B, 5 ;; This should get converted to an add
33 int "test4"(int %A, int %B) {
35 %D = add int %B, %C ; D = B + -A = B - A
39 int "test5"(int %A, int %B) {
41 %D = add int %C, %B ; D = -A + B = B - A