changeset 1196:20c590faad54

[Issue 443] New: assignment in return when using cdouble is broken Witold Baryluk <baryluk@mpi.int.pl> 2006-10-19 news:bug-443-3@http.d.puremagic.com/issues/
author thomask
date Sat, 21 Oct 2006 13:27:26 +0000
parents 9dbb7f24d251
children 0e1bf1565db1
files run/r/return_09_A.d run/r/return_09_B.d run/r/return_09_C.d
diffstat 3 files changed, 105 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/r/return_09_A.d	Sat Oct 21 13:27:26 2006 +0000
@@ -0,0 +1,35 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Witold Baryluk <baryluk@mpi.int.pl>
+// @date@	2006-10-19
+// @uri@	news:bug-443-3@http.d.puremagic.com/issues/
+// @desc@	[Issue 443] New: assignment in return when using cdouble is broken
+
+module dstress.run.r.return_09_A;
+
+cdouble y;
+
+cdouble f(cdouble x) {
+    return (y = x);
+}
+
+int main() {
+	cdouble z = f(1.0+2.0i);
+
+	if(y.re != 1.0){
+		assert(0);
+	}
+	if(y.im != 2.0){
+		assert(0);
+	}
+	if(z.re != 1.0){
+		assert(0);
+	}
+	if(z.im != 2.0){
+		assert(0);
+	}
+
+	return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/r/return_09_B.d	Sat Oct 21 13:27:26 2006 +0000
@@ -0,0 +1,35 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Witold Baryluk <baryluk@mpi.int.pl>
+// @date@	2006-10-19
+// @uri@	news:bug-443-3@http.d.puremagic.com/issues/
+// @desc@	[Issue 443] New: assignment in return when using cdouble is broken
+
+module dstress.run.r.return_09_B;
+
+cfloat y;
+
+cfloat f(cfloat x) {
+    return (y = x);
+}
+
+int main() {
+	cfloat z = f(1.0f + 2.0fi);
+
+	if(y.re != 1.0f){
+		assert(0);
+	}
+	if(y.im != 2.0f){
+		assert(0);
+	}
+	if(z.re != 1.0f){
+		assert(0);
+	}
+	if(z.im != 2.0f){
+		assert(0);
+	}
+
+	return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/r/return_09_C.d	Sat Oct 21 13:27:26 2006 +0000
@@ -0,0 +1,35 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Witold Baryluk <baryluk@mpi.int.pl>
+// @date@	2006-10-19
+// @uri@	news:bug-443-3@http.d.puremagic.com/issues/
+// @desc@	[Issue 443] New: assignment in return when using cdouble is broken
+
+module dstress.run.r.return_09_C;
+
+creal y;
+
+creal f(creal x) {
+    return (y = x);
+}
+
+int main() {
+	creal z = f(1.0 + 2.0i);
+
+	if(y.re != 1.0){
+		assert(0);
+	}
+	if(y.im != 2.0){
+		assert(0);
+	}
+	if(z.re != 1.0){
+		assert(0);
+	}
+	if(z.im != 2.0){
+		assert(0);
+	}
+
+	return 0;
+}