In gcc/testsuite/: 2011-03-04 Nicola Pero <nicola.pero@meta-innovation.com>
[official-gcc.git] / gcc / testsuite / gcc.dg / pr32912-1.c
blob4fcc29a9cc8b185490855d296df28ba27c6a09a8
1 /* PR middle-end/32912 */
2 /* { dg-do run } */
3 /* { dg-options "-O2 -w" } */
4 /* { dg-options "-O2 -w -fno-common" { target hppa*-*-hpux* } } */
5 /* { dg-options "-O2 -w -msse" { target { i?86-*-* x86_64-*-* } } } */
6 /* { dg-require-effective-target sse_runtime { target { i?86-*-* x86_64-*-* } } } */
8 extern void abort (void);
10 typedef int __m128i __attribute__ ((__vector_size__ (16)));
12 __m128i a, b, c, d, e, f;
14 void
15 foo (__m128i x)
17 a = x ^ ~x;
18 b = ~x ^ x;
19 c = x | ~x;
20 d = ~x | x;
21 e = x & ~x;
22 f = ~x & x;
25 int
26 main (void)
28 union { __m128i v; int i[sizeof (__m128i) / sizeof (int)]; } u;
29 int i;
31 for (i = 0; i < sizeof (u.i) / sizeof (u.i[0]); i++)
32 u.i[i] = i * 49 - 36;
33 foo (u.v);
34 #define check(x, val) \
35 u.v = (x); \
36 for (i = 0; i < sizeof (u.i) / sizeof (u.i[0]); i++) \
37 if (u.i[i] != (val)) \
38 abort ()
40 check (a, ~0);
41 check (b, ~0);
42 check (c, ~0);
43 check (d, ~0);
44 check (e, 0);
45 check (f, 0);
46 return 0;