comparison test/multiarr1.d @ 339:385a18242485 trunk

[svn r360] Another mostly rewrite of DtoArrayInit. Should be much more robust now, and probably faster code generated for the most common cases too! Fixed issues with slice initialization (!!!) of multidimensional static arrays. Attempt to fix issue with referencing nested 'this' pointers introduced in DMD 1.033 merge.
author lindquist
date Sun, 13 Jul 2008 01:29:49 +0200
parents 61615fa85940
children
comparison
equal deleted inserted replaced
338:0c90d816394f 339:385a18242485
1 module multiarr1; 1 module multiarr1;
2 2
3 void main() 3 void main()
4 { 4 {
5 int[16][16] a; 5 int[16][16] a;
6 assert(a[0][0] == 0);
7 assert(a[0][1] == 0);
8 assert(a[0][2] == 0);
9 assert(a[0][3] == 0);
10 assert(a[10][13] == 0);
11 assert(a[15][15] == 0);
6 a[10][13] = 42; 12 a[10][13] = 42;
7 //assert(a[0][0] == 0); 13 assert(a[0][0] == 0);
8 //assert(a[10][13] == 42); 14 assert(a[10][13] == 42);
15 assert(a[15][15] == 0);
9 { 16 {
10 int* l = cast(int*)a; 17 int* l = cast(int*)a;
11 l += 10*16+13; 18 l += 10*16+13;
12 assert(*l == 42); 19 assert(*l == 42);
13 } 20 }