PR c++/79899
[official-gcc.git] / gcc / testsuite / g++.dg / other / pr40446.C
blob72cd1960649e16289808601c4faab2df9687856e
1 // PR middle-end/40446
2 // { dg-do run { target i?86-*-* x86_64-*-* } }
3 // { dg-options "-O1 -msse2" }
4 // { dg-require-effective-target sse2_runtime }
6 #include <emmintrin.h>
8 extern "C" void abort ();
10 struct S
12   S (double r, double i) { __real__ s = r; __imag__ s = i; }
13   __complex__ double s;
16 __m128d
17 foo ()
19   S c (0, 1);
20   return _mm_load_pd ((double *) &c);
23 static void
24 __attribute__((noinline))
25 sse2_test ()
27   union { __m128d vec; double val[2]; } u;
28   u.vec = foo ();
29   if (u.val[0] != 0 || u.val[1] != 1)
30     abort ();
33 int
34 main ()
36   sse2_test ();
37   return 0;