blob: 5f6baf4402d054ce61181ef2226f2c4ac5a66407 [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
5; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel | grep 'mov ' | wc -l | grep 6
Chris Lattnerae37c2a2005-01-02 02:30:04 +00006
7%G = external global int
8
9declare void %ext(int)
10
11int %add_test(int %X, int %Y) {
12 %Z = add int %X, %Y ;; Last use of Y, but not of X.
13 store int %Z, int* %G
14 ret int %X
15}
16
17int %xor_test(int %X, int %Y) {
18 %Z = xor int %X, %Y ;; Last use of Y, but not of X.
19 store int %Z, int* %G
20 ret int %X
21}