summaryrefslogtreecommitdiff
path: root/test/CodeGen/Mips/inlineasmmemop.ll
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanak@gmail.com>2011-06-09 03:31:05 +0000
committerAkira Hatanaka <ahatanak@gmail.com>2011-06-09 03:31:05 +0000
commitc53cc48ca98c86a9ccb9de632c77890c5f7ea2d5 (patch)
treeb1f951ab37c9a774f7a83c653bf30599d4710fbd /test/CodeGen/Mips/inlineasmmemop.ll
parentc4f78208b399111cc4f5d97ed1875566819f34b4 (diff)
downloadllvm-c53cc48ca98c86a9ccb9de632c77890c5f7ea2d5.tar.gz
llvm-c53cc48ca98c86a9ccb9de632c77890c5f7ea2d5.tar.bz2
llvm-c53cc48ca98c86a9ccb9de632c77890c5f7ea2d5.tar.xz
Initial support for inline asm memory operand constraints.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132768 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/Mips/inlineasmmemop.ll')
-rw-r--r--test/CodeGen/Mips/inlineasmmemop.ll23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/CodeGen/Mips/inlineasmmemop.ll b/test/CodeGen/Mips/inlineasmmemop.ll
new file mode 100644
index 0000000000..c5658923dc
--- /dev/null
+++ b/test/CodeGen/Mips/inlineasmmemop.ll
@@ -0,0 +1,23 @@
+; RUN: llc -march=mipsel -mcpu=4ke < %s | FileCheck %s
+
+@g1 = external global i32
+
+define i32 @f1(i32 %x) nounwind {
+entry:
+; CHECK: addiu $[[T0:[0-9]+]], $sp
+; CHECK: #APP
+; CHECK: sw $4, 0($[[T0]])
+; CHECK: #NO_APP
+; CHECK: lw $[[T1:[0-9]+]], %got(g1)($gp)
+; CHECK: #APP
+; CHECK: lw $[[T3:[0-9]+]], 0($[[T0]])
+; CHECK: #NO_APP
+; CHECK: sw $[[T3]], 0($[[T1]])
+
+ %l1 = alloca i32, align 4
+ call void asm "sw $1, $0", "=*m,r"(i32* %l1, i32 %x) nounwind
+ %0 = call i32 asm "lw $0, $1", "=r,*m"(i32* %l1) nounwind
+ store i32 %0, i32* @g1, align 4
+ ret i32 %0
+}
+