view run/r/return_09_B.d @ 1630:d0efa3ae5522 default tip

run/mini/naked_asm5: New x86_64 ABI passes the arguments in reverse order.
author David Nadlinger <code@klickverbot.at>
date Sat, 23 Apr 2011 22:57:32 +0200
parents daef239f37cf
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;
}