2008-03-21 Janne Blomqvist <jb@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gcc.dg / pr32912-1.c
blob1ceb77ad43cd8853b66b7b4ba2b559200b6f777f
1 /* PR middle-end/32912 */
2 /* { dg-do run } */
3 /* { dg-options "-O2 -w" } */
4 /* { dg-options "-O2 -w -fno-common" { target hppa*-*-hpux* } } */
6 extern void abort (void);
8 typedef int __m128i __attribute__ ((__vector_size__ (16)));
10 __m128i a, b, c, d, e, f;
12 void
13 foo (__m128i x)
15 a = x ^ ~x;
16 b = ~x ^ x;
17 c = x | ~x;
18 d = ~x | x;
19 e = x & ~x;
20 f = ~x & x;
23 int
24 main (void)
26 union { __m128i v; int i[sizeof (__m128i) / sizeof (int)]; } u;
27 int i;
29 for (i = 0; i < sizeof (u.i) / sizeof (u.i[0]); i++)
30 u.i[i] = i * 49 - 36;
31 foo (u.v);
32 #define check(x, val) \
33 u.v = (x); \
34 for (i = 0; i < sizeof (u.i) / sizeof (u.i[0]); i++) \
35 if (u.i[i] != (val)) \
36 abort ()
38 check (a, ~0);
39 check (b, ~0);
40 check (c, ~0);
41 check (d, ~0);
42 check (e, 0);
43 check (f, 0);
44 return 0;