PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / pr52736.c
blobf35c1fd6c66517b6f5091ef0477a4a87fecb10c4
1 /* PR target/52736 */
2 /* { dg-do run } */
3 /* { dg-options "-O1 -msse2" } */
4 /* { dg-require-effective-target sse2_runtime } */
6 #include <x86intrin.h>
8 typedef double D __attribute__((may_alias));
9 __attribute__((aligned(16))) static const double r[4] = { 1., 5., 1., 3. };
11 __attribute__((noinline, noclone))
12 void
13 foo (int x)
15 asm volatile ("" : "+g" (x) : : "memory");
16 if (x != 3)
17 __builtin_abort ();
20 int
21 main ()
23 __m128d t = _mm_set1_pd (5.);
24 ((D *)(&t))[0] = 1.;
25 foo (_mm_movemask_pd (_mm_cmpeq_pd (t, _mm_load_pd (&r[0]))));
26 ((D *)(&t))[1] = 3.;
27 foo (_mm_movemask_pd (_mm_cmpeq_pd (t, _mm_load_pd (&r[2]))));
28 return 0;