1 ; RUN: llvm-upgrade < %s | llvm-as | opt -reassociate -dce | llvm-dis | \
2 ; RUN: not grep {\\(and\\|sub\\)}
4 int %test1(int %a, int %b) {
5 %tmp.2 = and int %b, %a
6 %tmp.4 = xor int %a, -1
7 %tmp.5 = and int %tmp.2, %tmp.4 ; (A&B)&~A == 0
11 int %test2(int %a, int %b) {
12 %tmp.1 = and int %a, 1234
13 %tmp.2 = and int %b, %tmp.1
14 %tmp.4 = xor int %a, -1
15 %tmp.5 = and int %tmp.2, %tmp.4 ; A&~A == 0
19 int %test3(int %b, int %a) {
20 %tmp.1 = add int %a, 1234
21 %tmp.2 = add int %b, %tmp.1
22 %tmp.4 = sub int 0, %a
23 %tmp.5 = add int %tmp.2, %tmp.4 ; (b+(a+1234))+-a -> b+1234