view run/a/associative_array_23_B.d @ 1572:169ba9b6cb5d

[Issue 1013] Invalid code generated for naked functions with (u)long arguments <madou@madou.org> 2007-03-01 http://d.puremagic.com/issues/show_bug.cgi?id=1013
author thomask
date Thu, 21 Feb 2008 15:18:50 +0000
parents ca435c6f02c8
children
line wrap: on
line source

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

module dstress.run.a.associative_array_23_B;

int main(){
	auto arr = [4:"vier", 0:"null", 2:"zwei"];

	if(3 != arr.length){
		assert(0);
	}
	
	char[][] master_e = ["vier", "null", "zwei"];
	int[] master_i = [4, 0, 2];

	foreach(index, element; arr){
		bool found = false;
		foreach(pos, i; master_i){
			if(index == i && element == master_e[pos]){
				master_i = master_i[0 .. pos] ~ master_i[pos+1 .. $];
				master_e = master_e[0 .. pos] ~ master_e[pos+1 .. $];
				found = true;
				break;
			}
		}
		if(!found){
			assert(0);
		}
	}
	if(master_i.length){
		assert(0);
	}
	return 0;
}