Added a load folding bug test case.
[oota-llvm.git] / test / CodeGen / X86 / 2006-01-19-ISelFoldingBug.ll
1 ; RUN: llvm-as < %s | llc -march=x86 | grep 'shld' | wc -l | grep 1
2 ;
3 ; Check that the isel does not fold the shld, which already folds a load
4 ; and has two uses, into a store.
5 %A = external global uint
6
7 uint %test5(uint %B, ubyte %C) {
8         %tmp.1 = load uint *%A;
9         %tmp.2 = shl uint %tmp.1, ubyte %C
10         %tmp.3 = sub ubyte 32, %C
11         %tmp.4 = shr uint %B, ubyte %tmp.3
12         %tmp.5 = or uint %tmp.4, %tmp.2
13         store uint %tmp.5, uint* %A
14         ret uint %tmp.5
15 }