diff tests/mini/naked_asm5.d @ 1447:a400b1dd657f

fix assembly code for mingw32 in minitests
author Kelly Wilson <wilsonk cpsc.ucalgary.ca>
date Sun, 31 May 2009 11:01:02 -0600
parents 1b10a9c6e3e8
children e92e14690a4f
line wrap: on
line diff
--- a/tests/mini/naked_asm5.d	Sun May 31 12:43:59 2009 +0200
+++ b/tests/mini/naked_asm5.d	Sun May 31 11:01:02 2009 -0600
@@ -3,9 +3,17 @@
     version(X86)
     {
     const OP = (op == '+') ? "add" : "sub";
-    asm { naked; }
-    mixin("asm{"~OP~" EAX, [ESP+4];}");
-    asm { ret 4; }
+    version (mingw32)
+    {
+    	asm { naked; }
+    	mixin("asm{push EBP;mov EBP,ESP;sub ESP,8;mov ECX,[EBP+8];"~OP~" EAX, ECX;add ESP,8;pop EBP;}");
+    	asm { ret; }
+	} else
+	{
+    	asm { naked; }
+    	mixin("asm{"~OP~" EAX, [ESP+4];}");
+    	asm { ret 4; }
+	}
     }
     else version(X86_64)
     {