2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / other / pr49133.C
bloba59687f9c742a6e95029e42385cdd27d2ba37622
1 /* { dg-do run { target i?86-*-* x86_64-*-* } } */
2 /* { dg-options "-O2 -msse2" } */
3 /* { dg-require-effective-target sse2_runtime } */
5 #include <xmmintrin.h>
7 extern "C" void abort ();
9 typedef double double_a __attribute__((__may_alias__));
11 struct V
13   __m128d data;
16 int
17 main()
19   V a;
20   __m128d b;
22   b = _mm_set_pd (1., 0.);
23   a.data = _mm_set_pd (1., 0.);
24   a.data = _mm_add_pd (a.data,
25                        _mm_and_pd (_mm_cmpeq_pd (a.data, _mm_set1_pd (0.)),
26                                    _mm_set1_pd (2.)));
27   reinterpret_cast<double_a *>(&a.data)[1] += 1.;
28   b = _mm_add_pd (b, _mm_and_pd (_mm_cmpeq_pd (b, _mm_set1_pd (0.)),
29                                  _mm_set1_pd (1.)));
30   b = _mm_add_pd (b, _mm_and_pd (_mm_cmpeq_pd (b, _mm_set1_pd (1.)),
31                                  _mm_set1_pd (1.)));
32   if (_mm_movemask_pd (_mm_cmpeq_pd (a.data, b)) != 0x3)
33     abort();
35   return 0;