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 -die | dis | grep add
26 %C = sub int %B, 5 ;; This should get converted to an add
30 int %test4(int %A, int %B) {
32 %D = add int %B, %C ; D = B + -A = B - A
36 int %test5(int %A, int %B) {
38 %D = add int %C, %B ; D = -A + B = B - A
44 %C = add int %B, %A ; C = 7*A+A == 8*A == A << 3
50 %C = add int %A, %B ; C = A+7*A == 8*A == A << 3
54 int %test8(int %A, int %B) { ; (A & C1)+(B & C2) -> (A & C1)|(B & C2) iff C1&C2 == 0