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: as < %s | opt -instcombine -die | dis | not grep add
23 %C = sub int %B, 5 ;; This should get converted to an add
27 int %test4(int %A, int %B) {
29 %D = add int %B, %C ; D = B + -A = B - A
33 int %test5(int %A, int %B) {
35 %D = add int %C, %B ; D = -A + B = B - A
41 %C = add int %B, %A ; C = 7*A+A == 8*A == A << 3
47 %C = add int %A, %B ; C = A+7*A == 8*A == A << 3
51 int %test8(int %A, int %B) { ; (A & C1)+(B & C2) -> (A & C1)|(B & C2) iff C1&C2 == 0