[cfe-commits] r161908 - /cfe/trunk/test/CodeGen/ms-inline-asm.c

Chad Rosier mcrosier at apple.com
Tue Aug 14 16:48:41 PDT 2012


Author: mcrosier
Date: Tue Aug 14 18:48:41 2012
New Revision: 161908

URL: http://llvm.org/viewvc/llvm-project?rev=161908&view=rev
Log:
[ms-inline asm] More test cases to make sure buildMSAsmString() doesn't regress.

Modified:
    cfe/trunk/test/CodeGen/ms-inline-asm.c

Modified: cfe/trunk/test/CodeGen/ms-inline-asm.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/ms-inline-asm.c?rev=161908&r1=161907&r2=161908&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/ms-inline-asm.c (original)
+++ cfe/trunk/test/CodeGen/ms-inline-asm.c Tue Aug 14 18:48:41 2012
@@ -43,3 +43,45 @@
 // CHECK: ret void
   __asm mov ebx, eax __asm mov ecx, ebx
 }
+
+void t6(void) {
+  __asm int 0x2c
+// CHECK: t6
+// CHECK: call void asm sideeffect "int 0x2c", "~{dirflag},~{fpsr},~{flags}"() nounwind ia_nsdialect
+}
+
+void* t7(void) {
+  __asm mov eax, fs:[0x10]
+// CHECK: t7
+// CHECK: call void asm sideeffect "mov eax, fs:[0x10]", "~{dirflag},~{fpsr},~{flags}"() nounwind ia_nsdialect
+}
+
+void t8() {
+  __asm {
+    int 0x2c ; } asm comments are fun! }{
+  }
+  __asm {}
+// CHECK: t8
+// CHECK: call void asm sideeffect "int 0x2c", "~{dirflag},~{fpsr},~{flags}"() nounwind ia_nsdialect
+// CHECK: call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"() nounwind ia_nsdialect
+}
+int t9() {
+  __asm int 3 ; } comments for single-line asm
+  __asm {}
+  __asm int 4
+  return 10;
+// CHECK: t9
+// CHECK: call void asm sideeffect "int 3", "~{dirflag},~{fpsr},~{flags}"() nounwind ia_nsdialect
+// CHECK: call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"() nounwind ia_nsdialect
+// CHECK: call void asm sideeffect "int 4", "~{dirflag},~{fpsr},~{flags}"() nounwind ia_nsdialect
+// CHECK: ret i32 10
+}
+void t10() {
+  __asm {
+    push ebx
+    mov ebx, 0x07
+    pop ebx
+  }
+// CHECK: t10
+// CHECK: call void asm sideeffect "push ebx\0Amov ebx, 0x07\0Apop ebx", "~{dirflag},~{fpsr},~{flags}"() nounwind ia_nsdialect
+}





More information about the cfe-commits mailing list