Test case for PR770
[oota-llvm.git] / test / CodeGen / X86 / 2006-05-08-CoalesceSubRegClass.ll
1 ; Coalescing from R32 to a subset R32_. Once another register coalescer bug is
2 ; fixed, the movb should go away as well.
3
4 ; RUN: llvm-as < %s | llc -march=x86 -relocation-model=static | grep 'movl' | wc -l
5
6 %B = external global uint
7 %C = external global ushort*
8
9 void %test(uint %A) {
10         %A = cast uint %A to ubyte
11         %tmp2 = load uint* %B
12         %tmp3 = and ubyte %A, 16
13         %tmp4 = shl uint %tmp2, ubyte %tmp3
14         store uint %tmp4, uint* %B
15         %tmp6 = shr uint %A, ubyte 3
16         %tmp = load ushort** %C
17         %tmp8 = cast ushort* %tmp to uint
18         %tmp9 = add uint %tmp8, %tmp6
19         %tmp9 = cast uint %tmp9 to ushort*
20         store ushort* %tmp9, ushort** %C
21         ret void
22 }