Mips specific inline asm operand modifier 'D'
[oota-llvm.git] / test / CodeGen / Mips / inlineasmmemop.ll
index 1c7c4437b892cec4e26f8a3173b8ee067203f358..dbd62a165d4d28e3d98c9d5c0cd8b805f447c289 100644 (file)
@@ -1,5 +1,6 @@
 ; RUN: llc -march=mipsel < %s | FileCheck %s
 
+; Simple memory
 @g1 = external global i32
 
 define i32 @f1(i32 %x) nounwind {
@@ -21,3 +22,19 @@ entry:
   ret i32 %0
 }
 
+; "D": Second word of double word. This works for any memory element.
+; CHECK: #APP
+; CHECK-NEXT: lw ${{[0-9]+}},4(${{[0-9]+}});
+; CHECK-NEXT: #NO_APP
+
+@b = common global [20 x i32] zeroinitializer, align 4
+
+define void @main() #0 {
+entry:
+  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)) #1
+  ret void
+}
+
+attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"="true" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #1 = { nounwind }
+