aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.dg/simd7951.d
blob: 4e467ef0f96663c7552b84064e0c3f21fcc829cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// https://issues.dlang.org/show_bug.cgi?id=7951
// { dg-additional-options "-mavx" { target avx_runtime } }
// { dg-do compile { target { avx_runtime || vect_sizes_16B_8B } } }
import core.simd;

float[4] test7951()
{
    float4 v1;
    float4 v2;

    return cast(float[4])(v1+v2);
}

void test7951_2()
{
    float[4] v1 = [1,2,3,4];
    float[4] v2 = [1,2,3,4];
    float4 f1, f2, f3;
    f1.array = v1;
    f2.array = v2;
    f3 = f1 + f2;
    assert((cast(float[4])f3)[2] == 6);
}