blob: 860c15979080b9436ed7b57c02898ca5ece1a042 [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
4; Check that there are no register-register copies left.
5; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel | not grep 'mov %E.X, %E.X'
6
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}