Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / gcc.dg / pr32912-2.c
blobf3c754cc346f2743a41d141a3a0f834aadb1fa10
1 /* { dg-do run } */
2 /* { dg-options "-O2 -w" } */
4 extern void abort (void);
6 #if(__SIZEOF_INT__ >= 4)
7 typedef int __m128i __attribute__ ((__vector_size__ (16)));
8 #else
9 typedef long __m128i __attribute__ ((__vector_size__ (16)));
10 #endif
11 __m128i
12 foo (void)
14 __m128i x = { 0x11111111, 0x22222222, 0x44444444 };
15 return x;
18 __m128i
19 bar (void)
21 __m128i x = { 0x11111111, 0x22222222, 0x44444444 };
22 return ~x;
25 int
26 main (void)
28 #if(__SIZEOF_INT__ >= 4)
29 union { __m128i v; int i[sizeof (__m128i) / sizeof (int)]; } u, v;
30 #else
31 union { __m128i v; long i[sizeof (__m128i) / sizeof (long)]; } u, v;
32 #endif
33 int i;
35 u.v = foo ();
36 v.v = bar ();
37 for (i = 0; i < sizeof (u.i) / sizeof (u.i[0]); i++)
39 if (u.i[i] != ~v.i[i])
40 abort ();
41 if (i < 3)
43 if (u.i[i] != (0x11111111 << i))
44 abort ();
46 else if (u.i[i])
47 abort ();
49 return 0;