view run/s/struct_initialization_13_A.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 6424a05d3113
children
line wrap: on
line source

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

// @author@	<pop.atry@gmail.com>
// @date@	2007-09-21
// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=1523
// @desc@	[Issue 1523] struct literals not work with typedef

module dstress.run.s.struct_initialization_13_A;

struct BaseStruct {
	int n;
	char c;
}

typedef BaseStruct MyStruct;

int myFunction(MyStruct m){
	return m.n + m.c * 2;
}

int main() {
	if(7 != myFunction(MyStruct(3, '\x02'))){
		assert(0);
	}

        return 0;
}