Remove llvm-upgrade and update tests.
[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-as < %s | llc -march=x86 -x86-asm-syntax=intel | \
6 ; RUN:   grep {\\\<mov\\\>} | count 6
7
8
9 target triple = "i686-pc-linux-gnu"
10 @G = external global i32                ; <i32*> [#uses=2]
11
12 declare void @ext(i32)
13
14 define i32 @add_test(i32 %X, i32 %Y) {
15         %Z = add i32 %X, %Y             ; <i32> [#uses=1]
16         store i32 %Z, i32* @G
17         ret i32 %X
18 }
19
20 define i32 @xor_test(i32 %X, i32 %Y) {
21         %Z = xor i32 %X, %Y             ; <i32> [#uses=1]
22         store i32 %Z, i32* @G
23         ret i32 %X
24 }
25