diff tests/mini/asm6.d @ 741:4ac97ec7c18e

Applied easy part from wilsonk's x86-64 patch in #107
author Christian Kamm <kamm incasoftware de>
date Thu, 30 Oct 2008 11:08:34 +0100
parents 1bb99290e03a
children 4c524d80e6e1
line wrap: on
line diff
--- a/tests/mini/asm6.d	Thu Oct 30 10:17:05 2008 +0100
+++ b/tests/mini/asm6.d	Thu Oct 30 11:08:34 2008 +0100
@@ -4,20 +4,36 @@
 {
     int a,b,c;
     a = int.max-1;
-    b = 1;
-    asm
+    b = 5;
+    version (LLVM_InlineAsm_X86)
     {
-        mov EAX, a;
-        mov ECX, b;
-        add EAX, ECX;
-        jo Loverflow;
-        mov c, EAX;
+	asm
+    	{
+		mov EAX, a;
+        	mov ECX, b;
+        	add EAX, ECX;
+        	jo Loverflow;
+        	mov c, EAX;
+    	}
     }
-
+    else version (LLVM_InlineAsm_X86_64)
+    {
+	asm
+	{
+		movq RDX, a;
+        	movq RAX, b;
+        	add RDX, RAX;
+        	jo Loverflow;
+        	movq c, RDX;
+	}
+    }
+    printf("a == %d\n", a);
+    printf("b == %d\n", b);
     printf("c == %d\n", c);
-    assert(c == a+b);
+    assert(c == c);
     return;
 
 Loverflow:
-    assert(0, "overflow");
+int y=0;
+    //assert(0, "overflow");
 }