Debian Codegraph @

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

raw
1 // { dg-additional-options "-mavx" { target avx_runtime } }
2 // { dg-do run { target { avx_runtime || vect_sizes_16B_8B } } }
3 // { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
4 import core.simd;
5
6 struct Sunsto
7 {
8 align (1): // make sure f4 is misaligned
9 byte b;
10 union
11 {
12 float4 f4;
13 ubyte[16] a;
14 }
15 }
16
17 ubyte[16] foounsto()
18 {
19 float4 vf = 6;
20 Sunsto s;
21 s.f4 = vf * 2;
22 vf = s.f4;
23
24 return s.a;
25 }
26
27 void main()
28 {
29 auto a = foounsto();
30 version (LittleEndian)
31 assert(a == [0, 0, 64, 65, 0, 0, 64, 65, 0, 0, 64, 65, 0, 0, 64, 65]);
32 version (BigEndian)
33 assert(a == [65, 64, 0, 0, 65, 64, 0, 0, 65, 64, 0, 0, 65, 64, 0, 0]);
34 }