[mips] Clean up the CodeGen/Mips/inlineasmmemop.ll test. NFC.
[oota-llvm.git] / test / CodeGen / Mips / inlineasmmemop.ll
index 1c7c4437b892cec4e26f8a3173b8ee067203f358..5518520c549181503fdcc9c83f4c6315b9862e67 100644 (file)
@@ -1,9 +1,11 @@
 ; RUN: llc -march=mipsel < %s | FileCheck %s
 
+; Simple memory
 @g1 = external global i32
 
 define i32 @f1(i32 %x) nounwind {
 entry:
+; CHECK-LABEL: f1:
 ; CHECK: addiu $[[T0:[0-9]+]], $sp
 ; CHECK: #APP
 ; CHECK: sw $4, 0($[[T0]])
@@ -21,3 +23,26 @@ entry:
   ret i32 %0
 }
 
+; CHECK-LABEL: main:
+; "D": Second word of a double word. This works for any memory element
+; double or single.
+; CHECK: #APP
+; CHECK: lw ${{[0-9]+}},4(${{[0-9]+}});
+; CHECK: #NO_APP
+
+; No "D": First word of a double word. This works for any memory element
+; double or single.
+; CHECK: #APP
+; CHECK: lw ${{[0-9]+}},0(${{[0-9]+}});
+; CHECK: #NO_APP
+
+@b = common global [20 x i32] zeroinitializer, align 4
+
+define void @main() {
+entry:
+; Second word:
+  tail call void asm sideeffect "    lw    $0,${1:D};", "r,*m,~{$11}"(i32 undef, i32* getelementptr inbounds ([20 x i32]* @b, i32 0, i32 3))
+; First word. Notice, no 'D':
+  tail call void asm sideeffect "    lw    $0,${1};", "r,*m,~{$11}"(i32 undef, i32* getelementptr inbounds ([20 x i32]* @b, i32 0, i32 3))
+  ret void
+}