aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@mips.com>2011-12-21 00:31:10 +0000
committerAkira Hatanaka <ahatanaka@mips.com>2011-12-21 00:31:10 +0000
commitc7541c49a9dbb88c0ffe4b74bc8065eb68585148 (patch)
tree997ce780418f4e3176495d5042562ac688b9d50d /test
parentc79507a4dd0c64e3d96fee6c57d0b2e3d14f4b77 (diff)
downloadexternal_llvm-c7541c49a9dbb88c0ffe4b74bc8065eb68585148.zip
external_llvm-c7541c49a9dbb88c0ffe4b74bc8065eb68585148.tar.gz
external_llvm-c7541c49a9dbb88c0ffe4b74bc8065eb68585148.tar.bz2
Fix bug in zero-store peephole pattern reported in pr11615.
The patch and test case were originally written by Mans Rullgard. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147024 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/Mips/swzero.ll19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/CodeGen/Mips/swzero.ll b/test/CodeGen/Mips/swzero.ll
new file mode 100644
index 0000000..da1e036
--- /dev/null
+++ b/test/CodeGen/Mips/swzero.ll
@@ -0,0 +1,19 @@
+; RUN: llc -march=mipsel < %s | FileCheck %s
+
+%struct.unaligned = type <{ i32 }>
+
+define void @zero_u(%struct.unaligned* nocapture %p) nounwind {
+entry:
+; CHECK: usw $zero
+ %x = getelementptr inbounds %struct.unaligned* %p, i32 0, i32 0
+ store i32 0, i32* %x, align 1
+ ret void
+}
+
+define void @zero_a(i32* nocapture %p) nounwind {
+entry:
+; CHECK: sw $zero
+ store i32 0, i32* %p, align 4
+ ret void
+}
+