view run/o/odd_bug_07_C.d @ 1385:62c9b99c3a16

meta cleanup
author thomask
date Sun, 04 Mar 2007 13:12:19 +0000
parents d374abf09616
children 1ee9a0dd42d9
line wrap: on
line source

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

// @author@	 Deewiant <deewiant@gmail.com>
// @date@	2006-08-19
// @uri@	news:ec6kit$560$1@digitaldaemon.com
// @desc@	[Issue 287] DMD optimization bug arround dynamic array length

module dstress.run.o.odd_bug_07_C;

int main() {
	int lng, lngnew;

	int[] arr = new int[1];

	for (int i = 10; i--;) {
		lngnew = lng + arr.length;
		lng = lngnew;

		lngnew = lng + arr.length;

		if(lng + 1 != lngnew){
			assert(0);
		}
		
		lng = lngnew;
	}

	return 0;
}