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

float test19224(const float[4] val)
{
    float sum = 0;
    foreach (x; val) sum += x;
    return sum;
}

enum x19224 = test19224(float4.init.array);
static assert(x19224 is float.nan);

enum y19224 = test19224(float4(1).array);
static assert(y19224 == 4);