PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / pr54703.c
blobe30c293c0766b18c78ca21a7626419f08f9ece7f
1 /* PR target/54703 */
2 /* { dg-do run { target sse2_runtime } } */
3 /* { dg-options "-O -msse2" } */
4 /* { dg-additional-options "-mavx -mtune=bdver1" { target avx_runtime } } */
6 extern void abort (void);
7 typedef double V __attribute__((vector_size(16)));
9 union {
10 unsigned long long m[2];
11 V v;
12 } u = { { 0xffffffffff000000ULL, 0xffffffffff000000ULL } };
14 static inline V
15 foo (V x)
17 V y = __builtin_ia32_andpd (x, u.v);
18 V z = __builtin_ia32_subpd (x, y);
19 return __builtin_ia32_mulpd (y, z);
22 void
23 test (V *x)
25 V a = { 2.1, 2.1 };
26 *x = foo (foo (a));
29 int
30 main ()
32 test (&u.v);
33 if (u.m[0] != 0x3acbf487f0a30550ULL || u.m[1] != u.m[0])
34 abort ();
35 return 0;