* gcc.dg/torture/stackalign/builtin-apply-2.c: Fix skip-if syntax.
[official-gcc.git] / gcc / testsuite / gcc.dg / pr32912-2.c
blob2e800784d52e1fcc48c777e3a3bae63434f7deae
1 /* { dg-do run } */
2 /* { dg-options "-O2 -w" } */
4 extern void abort (void);
6 #if(__SIZEOF_INT__ >= 4)
7 # define TYPE int
8 # define TYPED(a) a
10 #elif(__SIZEOF_INT__ > 2)
11 # define TYPE long
12 # define TYPED(a) a##L
14 #else
15 # define TYPE long long
16 # define TYPED(a) a##LL
17 #endif
20 typedef TYPE __m128i __attribute__ ((__vector_size__ (16)));
22 __m128i
23 foo (void)
25 __m128i x = { 0x11111111, 0x22222222, 0x44444444 };
26 return x;
29 __m128i
30 bar (void)
32 __m128i x = { 0x11111111, 0x22222222, 0x44444444 };
33 return ~x;
36 int
37 main (void)
39 union { __m128i v; TYPE i[sizeof (__m128i) / sizeof (TYPE)]; } u, v;
40 int i;
42 u.v = foo ();
43 v.v = bar ();
44 for (i = 0; i < sizeof (u.i) / sizeof (u.i[0]); i++)
46 if (u.i[i] != ~v.i[i])
47 abort ();
49 if (i < 3)
51 if (u.i[i] != (TYPED (0x11111111) << i))
52 abort ();
54 else if (u.i[i])
55 abort ();
57 return 0;