summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/runnable/imports/a7595.d
blob: a2b1dc10c413be5f8805564d4941f0ecdb323386 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
@trusted:

import test7595;

struct Matrix
{
    int[4] _data;
}

void inverse(const ref Matrix m)
{
    for (size_t i = 0; i < 4; i++)
        assert(m._data[i] == i + 1);
}

void main()
{
    Matrix m9;
    m9._data[0] = 1;
    m9._data[1] = 2;
    m9._data[2] = 3;
    m9._data[3] = 4;
    for (size_t i = 0; i < 4; i++)
        assert(m9._data[i] == i + 1);

    benchmark!({ inverse(m9); })(1);
}