view run/in_out_body_03.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 6e4063f99377
children
line wrap: on
line source

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

// @author@	Buchan <kbuchan@xtra.co.nz>
// @date@	2004-11-14
// @uri@	news:opshfzxz0b44buww@simon.homenet
// @uri@	http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=2262

// __DSTRESS_TORTURE_BLOCK__ -release

module dstress.run.in_out_body_03;

bool in_checked;
bool out_checked;

class MyClass{
	int i;
}

void outer(){
	MyClass inner()
	in{
		in_checked=true;
	}out (result){
		assert(result.i==1);
		out_checked=true;
	}body{
		MyClass s=new MyClass;
		s.i = 1;
		return s;
	}
	assert(inner.i==1);
}

int main(){
	outer();
	assert(in_checked);
	assert(out_checked);
	return 0;
}