Debian Codegraph @

gcc/testsuite/gdc.dg/torture/simd20041.d

raw
1 // https://issues.dlang.org/show_bug.cgi?id=20041
2 // { dg-additional-options "-mavx" { target avx_runtime } }
3 // { dg-do run { target { avx_runtime || vect_sizes_16B_8B } } }
4 // { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
5 import core.simd;
6
7 immutable(float4) test20041()
8 {
9 float4 raw = 2.0f;
10 raw.array[0] = 1;
11 return cast(immutable)raw;
12 }
13
14 void main()
15 {
16 static immutable float4 v = test20041();
17
18 assert(v.array[0] == 1);
19 assert(v.array[1] == 2);
20 assert(v.array[2] == 2);
21 assert(v.array[3] == 2);
22 }