aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.dg/pr106139d.d
blob: 4c6f0ef3a3a748512ccd874705cc9a4fc8cf1912 (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
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106139
// { dg-do compile }

alias V = float[4];
alias A = int[4];

static if (__traits(compiles, __vector(V))):

A vector2array(__vector(V) v)
{
    return cast(A)v;
}

void vector2array(ref A a, __vector(V) v)
{
    a = cast(A)v;
}

__vector(V) array2vector(A a)
{
    return cast(__vector(V)) a;
}

void array2vector(ref __vector(V) v, A a)
{
    v = cast(__vector(V))a;
}