view run/r/return_09_B.d @ 1320:daef239f37cf

sed'ed replacement of new:...http.d.puremagic.com/issues/ with http://d.puremagic.com/issues/show_bug.cgi?...
author thomask
date Sun, 31 Dec 2006 19:59:08 +0000
parents 20c590faad54
children
line wrap: on
line source

// $HeadURL$
// $Date$
// $Author$

// @author@	Witold Baryluk <baryluk@mpi.int.pl>
// @date@	2006-10-19
// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=443
// @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;
}