changeset 1425:10fb8b4eeae3

[Issue 1028] Segfault using tuple inside asm code. Don Clugston <clugdbug@yahoo.com.au> 2007-03-06 http://d.puremagic.com/issues/show_bug.cgi?id=1028
author thomask
date Sun, 11 Mar 2007 11:20:48 +0000
parents 73f829b7be2f
children 3204340ec93b
files run/t/tuple_19_A.d
diffstat 1 files changed, 38 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/t/tuple_19_A.d	Sun Mar 11 11:20:48 2007 +0000
@@ -0,0 +1,38 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Don Clugston <clugdbug@yahoo.com.au>
+// @date@	2007-03-06
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=1028
+// @desc@	[Issue 1028] Segfault using tuple inside asm code.
+
+module dstress.run.t.tuple_19_A;
+
+version(D_InlineAsm_X86){
+	version = test;
+}else version(D_InlineAsm_X86_64){
+	version = test;
+}else{
+	static assert(0, "DSTRESS{XFAIL}: no x86 inline asm support");
+}
+
+version(test){
+	int a(X...)(X x){
+		int i = 0xAB_CD_EF_12;
+		alias X[0] var1;
+		asm {
+			mov EAX, var1;
+			inc EAX;
+			mov i, EAX;
+		}
+		return i;
+	}
+
+	int main(){
+		if(4 != a(3)){
+			assert(0);
+		}
+		return 0;
+	}
+}