view run/f/foreach_31_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 f7434744e991
children
line wrap: on
line source

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

module dstress.run.f.foreach_31_B;

int main(){
	int[] index;
	char[] value;

	foreach(int i, char c; "_\U00012345-"d){
		index ~= i;
		value ~= c;
	}

	assert(value.length == 6);
	assert(value[0] == '_');
	assert(value[1] == 0xF0);
	assert(value[2] == 0x92);
	assert(value[3] == 0x8D);
	assert(value[4] == 0x85);
	assert(value[5] == '-');

	assert(index.length == 6);
	assert(index[0] == 0);
	assert(index[1] == 1);
	assert(index[2] == 1);
	assert(index[3] == 1);
	assert(index[4] == 1);
	assert(index[5] == 2);

	return 0;
}