d: Fix gdc -O2 -mavx generates misaligned vmovdqa instruction [PR114171]
[official-gcc.git] / gcc / testsuite / gdc.dg / torture / simd3.d
blob7ce26793e7afb2a76fd5d4959be42b632bd8480f
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;
6 struct Sunsto
8 align (1): // make sure f4 is misaligned
9 byte b;
10 union
12 float4 f4;
13 ubyte[16] a;
17 ubyte[16] foounsto()
19 float4 vf = 6;
20 Sunsto s;
21 s.f4 = vf * 2;
22 vf = s.f4;
24 return s.a;
27 void main()
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]);