]> granicus.if.org Git - clang/commitdiff
[ms-inline asm] Add more tests.
authorChad Rosier <mcrosier@apple.com>
Wed, 5 Dec 2012 19:52:05 +0000 (19:52 +0000)
committerChad Rosier <mcrosier@apple.com>
Wed, 5 Dec 2012 19:52:05 +0000 (19:52 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169411 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGen/ms-inline-asm.c

index 7f43da891e90c7760ebb539283210c62c33b0c2d..d0e9a7b1159cd181c1d3b31170bb570c82d94f21 100644 (file)
@@ -200,3 +200,32 @@ void t20() {
 // CHECK: t20
 // CHECK: call void asm sideeffect inteldialect "mov eax, $$4", "~{eax},~{dirflag},~{fpsr},~{flags}"() nounwind
 }
+
+
+void t21() {
+  __asm {
+    __asm push ebx
+    __asm mov ebx, 0x07
+    __asm pop ebx
+  }
+// CHECK: t21
+// CHECK: call void asm sideeffect inteldialect "push ebx\0A\09mov ebx, $$0x07\0A\09pop ebx", "~{ebx},~{dirflag},~{fpsr},~{flags}"() nounwind
+}
+
+extern void t22_helper(int x);
+void t22() {
+  int x = 0;
+  __asm {
+    __asm push ebx
+    __asm mov ebx, esp
+  }
+  t22_helper(x);
+  __asm {
+    __asm mov esp, ebx
+    __asm pop ebx
+  }
+// CHECK: t22
+// CHECK: call void asm sideeffect inteldialect "push ebx\0A\09mov ebx, esp", "~{ebx},~{dirflag},~{fpsr},~{flags}"() nounwind
+// CHECK: call void @t22_helper
+// CHECK: call void asm sideeffect inteldialect "mov esp, ebx\0A\09pop ebx", "~{ebx},~{esp},~{dirflag},~{fpsr},~{flags}"() nounwind
+}