Mercurial > projects > dstress
diff run/f/for_06_B.d @ 619:107d6211c81e
Deewiant <deewiant.doesnotlike.spam@gmail.com>
2005-08-06
news:dd23j9$1b6c$1@digitaldaemon.com
author | thomask |
---|---|
date | Sat, 06 Aug 2005 15:54:38 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/f/for_06_B.d Sat Aug 06 15:54:38 2005 +0000 @@ -0,0 +1,34 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Deewiant <deewiant.doesnotlike.spam@gmail.com> +// @date@ 2005-08-06 +// @uri@ news:dd23j9$1b6c$1@digitaldaemon.com + +// __DSTRESS_DFLAGS__ -O + +module dstress.run.f.for_06_B; + +int foo(inout real[] arr) { + size_t i = 1; + int counter; + + for(size_t j = arr.length-1; j >= i; j--) { + arr[j] = arr[j - i]; + counter++; + } + + return counter; +} + +int main(){ + real[] array; + array.length = 2; + + if(foo(array)==1){ + return 0; + }else{ + return 1; + } +} \ No newline at end of file