Debian Codegraph @

gcc/testsuite/gdc.dg/simd7951.d

raw
1 // https://issues.dlang.org/show_bug.cgi?id=7951
2 // { dg-additional-options "-mavx" { target avx_runtime } }
3 // { dg-do compile { target { avx_runtime || vect_sizes_16B_8B } } }
4 import core.simd;
5
6 float[4] test7951()
7 {
8 float4 v1;
9 float4 v2;
10
11 return cast(float[4])(v1+v2);
12 }
13
14 void test7951_2()
15 {
16 float[4] v1 = [1,2,3,4];
17 float[4] v2 = [1,2,3,4];
18 float4 f1, f2, f3;
19 f1.array = v1;
20 f2.array = v2;
21 f3 = f1 + f2;
22 assert((cast(float[4])f3)[2] == 6);
23 }