view norun/o/opSliceAssign_04_A.d @ 1576:b3e16c86558e

[Issue 1398] New: GDC doesn't generate correct code <mariusmuja@gmail.com> 2007-08-04 http://d.puremagic.com/issues/show_bug.cgi?id=1398
author thomask
date Thu, 21 Feb 2008 15:20:08 +0000
parents daef239f37cf
children
line wrap: on
line source

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

// @author@	Burton Radons <burton-radons@smocky.com>
// @date@	2006-12-07
// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=663
// @desc@	[Issue 663] New: Slice assignment does not bounds check when it should

// __DSTRESS_TORTURE_BLOCK__ -release

module dstress.norun.o.opSliceAssign_04_A;

int main(char[][] args){
        auto test = new char [(args.length / 1000) + 2];

        test [] = 'a';
	if(test != "aa"){
		assert(0);
	}

        test = test [0 .. (args.length / 1000) + 1];
	if(test != "a"){
		assert(0);
	}

        test [0 .. 2] = 'b';

	return 0;
}