Fortran: Fix PR 47485.
[gcc.git] / gcc / testsuite / g++.dg / other / pr49133.C
blobbd30cc749b983e05e6a67ca8a619fce4b86b3a34
1 /* { dg-do run { target i?86-*-* x86_64-*-* } } */
2 /* { dg-options "-O2 -msse2" } */
3 /* { dg-require-effective-target sse2_runtime } */
4 /* { dg-skip-if "requires hosted libstdc++ for cstdlib malloc" { ! hostedlib } } */
6 #include <xmmintrin.h>
8 extern "C" void abort ();
10 typedef double double_a __attribute__((__may_alias__));
12 struct V
14   __m128d data;
17 int
18 main()
20   V a;
21   __m128d b;
23   b = _mm_set_pd (1., 0.);
24   a.data = _mm_set_pd (1., 0.);
25   a.data = _mm_add_pd (a.data,
26                        _mm_and_pd (_mm_cmpeq_pd (a.data, _mm_set1_pd (0.)),
27                                    _mm_set1_pd (2.)));
28   reinterpret_cast<double_a *>(&a.data)[1] += 1.;
29   b = _mm_add_pd (b, _mm_and_pd (_mm_cmpeq_pd (b, _mm_set1_pd (0.)),
30                                  _mm_set1_pd (1.)));
31   b = _mm_add_pd (b, _mm_and_pd (_mm_cmpeq_pd (b, _mm_set1_pd (1.)),
32                                  _mm_set1_pd (1.)));
33   if (_mm_movemask_pd (_mm_cmpeq_pd (a.data, b)) != 0x3)
34     abort();
36   return 0;