changeset 1494:f39a9d671323

[Issue 1173] Inline assembler: cannot use global scope operator Matti Niemenmaa <deewiant@gmail.com> 2007-04-21 http://d.puremagic.com/issues/show_bug.cgi?id=1173
author thomask
date Mon, 23 Apr 2007 17:54:08 +0000
parents 1d830b6d7f62
children 7a686112b047
files run/a/asm_03_A.d run/a/asm_03_B.d run/a/asm_03_C.d run/a/asm_03_D.d
diffstat 4 files changed, 149 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/a/asm_03_A.d	Mon Apr 23 17:54:08 2007 +0000
@@ -0,0 +1,37 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Matti Niemenmaa <deewiant@gmail.com>
+// @date@	2007-04-21
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=1173
+// @desc@	[Issue 1173] Inline assembler: cannot use global scope operator
+
+module dstress.run.a.asm_03_A;
+
+version(D_InlineAsm_X86){
+	version = runTest;
+}else version(D_InlineAsm_X86_64){
+	version = runTest;
+}else{
+	static assert(0, "DSTRESS{XFAIL}: no inline ASM support");
+}
+
+version(runTest){
+	int x = 0x12AB_89EF;
+
+	int main(){
+		int y = 0xCAFFEE;
+
+		asm{
+			mov EAX, x;
+			mov y, EAX;
+		}
+
+		if(y != 0x12AB_89EF){
+			assert(0);
+		}
+
+		return 0;
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/a/asm_03_B.d	Mon Apr 23 17:54:08 2007 +0000
@@ -0,0 +1,37 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Matti Niemenmaa <deewiant@gmail.com>
+// @date@	2007-04-21
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=1173
+// @desc@	[Issue 1173] Inline assembler: cannot use global scope operator
+
+module dstress.run.a.asm_03_B;
+
+version(D_InlineAsm_X86){
+	version = runTest;
+}else version(D_InlineAsm_X86_64){
+	version = runTest;
+}else{
+	static assert(0, "DSTRESS{XFAIL}: no inline ASM support");
+}
+
+version(runTest){
+	int x = 0x12AB_89EF;
+
+	int main(){
+		int y = 0xCAFFEE;
+
+		asm{
+			mov EAX, .x;
+			mov y, EAX;
+		}
+
+		if(y != 0x12AB_89EF){
+			assert(0);
+		}
+
+		return 0;
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/a/asm_03_C.d	Mon Apr 23 17:54:08 2007 +0000
@@ -0,0 +1,38 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Matti Niemenmaa <deewiant@gmail.com>
+// @date@	2007-04-21
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=1173
+// @desc@	[Issue 1173] Inline assembler: cannot use global scope operator
+
+module dstress.run.a.asm_03_C;
+
+version(D_InlineAsm_X86){
+	version = runTest;
+}else version(D_InlineAsm_X86_64){
+	version = runTest;
+}else{
+	static assert(0, "DSTRESS{XFAIL}: no inline ASM support");
+}
+
+version(runTest){
+	int x = 0x12AB_89EF;
+
+	int main(){
+		alias .x X;
+		int y = 0xCAFFEE;
+
+		asm{
+			mov EAX, X;
+			mov y, EAX;
+		}
+
+		if(y != 0x12AB_89EF){
+			assert(0);
+		}
+
+		return 0;
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/a/asm_03_D.d	Mon Apr 23 17:54:08 2007 +0000
@@ -0,0 +1,37 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Matti Niemenmaa <deewiant@gmail.com>
+// @date@	2007-04-21
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=1173
+// @desc@	[Issue 1173] Inline assembler: cannot use global scope operator
+
+module dstress.run.a.asm_03_D;
+
+version(D_InlineAsm_X86){
+	version = runTest;
+}else version(D_InlineAsm_X86_64){
+	version = runTest;
+}else{
+	static assert(0, "DSTRESS{XFAIL}: no inline ASM support");
+}
+
+version(runTest){
+	int x = 0x12AB_89EF;
+
+	int main(){
+		int x = 0xCAFFEE;
+
+		asm{
+			mov EAX, .x;
+			mov x, EAX;
+		}
+
+		if(x != 0x12AB_89EF){
+			assert(0);
+		}
+
+		return 0;
+	}
+}