view tests/mini/marray3.d @ 978:6a32d2e18175

Fix a latent bug in the asm code. I think that technically, using "*m0" instead of "*0" allows LLVM to pick between using the same memory as output 0 and using a new memory location. (So far I haven't been able to construct a testcase that actually breaks because of this, though)
author Frits van Bommel <fvbommel wxs.nl>
date Wed, 18 Feb 2009 03:38:12 +0100
parents cc40db549aea
children
line wrap: on
line source

module tangotests.marray3;

void main()
{
    int[][][] ma = new int[][][](2,4,3);
    assert(ma.length == 2);
    assert(ma[0].length == 4);
    assert(ma[0][0].length == 3);
    assert(ma[0][1].length == 3);
    assert(ma[0][2].length == 3);
    assert(ma[0][3].length == 3);
    assert(ma[1].length == 4);
    assert(ma[1][0].length == 3);
    assert(ma[1][1].length == 3);
    assert(ma[1][2].length == 3);
    assert(ma[1][3].length == 3);
    ma[0][3][0] = 32;
    ma[1][2][1] = 123;
    ma[0][0][2] = 55;
    assert(ma[0][3][0] == 32);
    assert(ma[1][2][1] == 123);
    assert(ma[0][0][2] == 55);
}