aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-01-20 01:12:23 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-01-20 01:12:23 +0000
commit52b8b5982f8e795ebf89c289619d1feee13cf63f (patch)
treee7b88648f7573293156ed5733405fa6c64142caf /test/CodeGen
parent76356d95944ac2f560c0193c5ca314da7998a366 (diff)
downloadexternal_llvm-52b8b5982f8e795ebf89c289619d1feee13cf63f.zip
external_llvm-52b8b5982f8e795ebf89c289619d1feee13cf63f.tar.gz
external_llvm-52b8b5982f8e795ebf89c289619d1feee13cf63f.tar.bz2
Added a load folding bug test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25472 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen')
-rw-r--r--test/CodeGen/X86/2006-01-19-ISelFoldingBug.ll15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/CodeGen/X86/2006-01-19-ISelFoldingBug.ll b/test/CodeGen/X86/2006-01-19-ISelFoldingBug.ll
new file mode 100644
index 0000000..4dc9165
--- /dev/null
+++ b/test/CodeGen/X86/2006-01-19-ISelFoldingBug.ll
@@ -0,0 +1,15 @@
+; RUN: llvm-as < %s | llc -march=x86 | grep 'shld' | wc -l | grep 1
+;
+; Check that the isel does not fold the shld, which already folds a load
+; and has two uses, into a store.
+%A = external global uint
+
+uint %test5(uint %B, ubyte %C) {
+ %tmp.1 = load uint *%A;
+ %tmp.2 = shl uint %tmp.1, ubyte %C
+ %tmp.3 = sub ubyte 32, %C
+ %tmp.4 = shr uint %B, ubyte %tmp.3
+ %tmp.5 = or uint %tmp.4, %tmp.2
+ store uint %tmp.5, uint* %A
+ ret uint %tmp.5
+}