blob: 32eef1a435f70b054bbc0d5f6a2ace5d6e65909c [file] [log] [blame]
Chris Lattnerae37c2a2005-01-02 02:30:04 +00001; The register allocator can commute two-address instructions to avoid
2; insertion of register-register copies.
3
Chris Lattnerf2c7af22005-05-09 05:54:27 +00004; Make sure there are only 3 mov's for each testcase
Reid Spencerd3b1f6d2007-04-15 22:20:47 +00005; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=intel | \
Dan Gohman28beeea2007-08-15 13:36:28 +00006; RUN: grep {\\\<mov\\\>} | count 6
Chris Lattnerae37c2a2005-01-02 02:30:04 +00007
Chris Lattner837451b2005-07-20 03:56:48 +00008
9target triple = "i686-pc-linux-gnu"
10
Chris Lattnerae37c2a2005-01-02 02:30:04 +000011%G = external global int
12
13declare void %ext(int)
14
15int %add_test(int %X, int %Y) {
16 %Z = add int %X, %Y ;; Last use of Y, but not of X.
17 store int %Z, int* %G
18 ret int %X
19}
20
21int %xor_test(int %X, int %Y) {
22 %Z = xor int %X, %Y ;; Last use of Y, but not of X.
23 store int %Z, int* %G
24 ret int %X
25}