Use the llvm-upgrade program to upgrade llvm assembly.
[oota-llvm.git] / test / CodeGen / X86 / commute-two-addr.ll
1 ; The register allocator can commute two-address instructions to avoid
2 ; insertion of register-register copies.
3
4 ; Make sure there are only 3 mov's for each testcase
5 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=intel | grep 'mov ' | wc -l | grep 6
6
7
8 target triple = "i686-pc-linux-gnu"
9
10 %G = external global int
11
12 declare void %ext(int)
13
14 int %add_test(int %X, int %Y) {
15         %Z = add int %X, %Y      ;; Last use of Y, but not of X.
16         store int %Z, int* %G
17         ret int %X
18 }
19
20 int %xor_test(int %X, int %Y) {
21         %Z = xor int %X, %Y      ;; Last use of Y, but not of X.
22         store int %Z, int* %G
23         ret int %X
24 }