summaryrefslogtreecommitdiff
path: root/test/CodeGen/Mips/load-store-left-right.ll
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2012-08-15 19:34:23 +0000
committerDimitry Andric <dim@FreeBSD.org>2012-08-15 19:34:23 +0000
commit58b69754af0cbff56b1cfce9be9392e4451f6628 (patch)
treeeacfc83d988e4b9d11114387ae7dc41243f2a363 /test/CodeGen/Mips/load-store-left-right.ll
parent0378662f5bd3dbe8305a485b0282bceb8b52f465 (diff)
Notes
Diffstat (limited to 'test/CodeGen/Mips/load-store-left-right.ll')
-rw-r--r--test/CodeGen/Mips/load-store-left-right.ll29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/CodeGen/Mips/load-store-left-right.ll b/test/CodeGen/Mips/load-store-left-right.ll
new file mode 100644
index 0000000000000..d0928ee266131
--- /dev/null
+++ b/test/CodeGen/Mips/load-store-left-right.ll
@@ -0,0 +1,29 @@
+; RUN: llc -march=mipsel < %s | FileCheck -check-prefix=EL %s
+; RUN: llc -march=mips < %s | FileCheck -check-prefix=EB %s
+
+%struct.SI = type { i32 }
+
+@si = common global %struct.SI zeroinitializer, align 1
+
+define i32 @foo_load_i() nounwind readonly {
+entry:
+; EL: lwl $[[R0:[0-9]+]], 3($[[R1:[0-9]+]])
+; EL: lwr $[[R0]], 0($[[R1]])
+; EB: lwl $[[R0:[0-9]+]], 0($[[R1:[0-9]+]])
+; EB: lwr $[[R0]], 3($[[R1]])
+
+ %0 = load i32* getelementptr inbounds (%struct.SI* @si, i32 0, i32 0), align 1
+ ret i32 %0
+}
+
+define void @foo_store_i(i32 %a) nounwind {
+entry:
+; EL: swl $[[R0:[0-9]+]], 3($[[R1:[0-9]+]])
+; EL: swr $[[R0]], 0($[[R1]])
+; EB: swl $[[R0:[0-9]+]], 0($[[R1:[0-9]+]])
+; EB: swr $[[R0]], 3($[[R1]])
+
+ store i32 %a, i32* getelementptr inbounds (%struct.SI* @si, i32 0, i32 0), align 1
+ ret void
+}
+