view run/f/forward_reference_20_C.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 ca5b18e46ec7
children
line wrap: on
line source

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

// @author@	Bill Baxter <wbaxter@gmail.com>
// @date@	2007-03-12
// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=1055
// @desc@	[Issue 1055] union forward reference "overlapping initialization" error

module dstress.run.f.forward_reference_20_C;

struct S{
	int y = 0x1234_5678;
}

struct Z {
	union {
		S s;
	}
	int x = 0x9ABC_DEF0;
}

int main(){
	Z z;
	if(0x9ABC_DEF0 != z.x){
		assert(0);
	}
	if(0x1234_5678 != z.s.y){
		assert(0);
	}
	return 0;
}