OSDN Git Service

2012-04-13 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / torture / pr50067-4.c
1 /* { dg-do run } */
2
3 /* Verify we do not get a bogus access function with 0B vs. 1B which
4    disambiguates both accesses and leads to vectorization.  */
5
6 extern int memcmp(const void *, const void *, __SIZE_TYPE__);
7 extern void abort (void);
8 short a[33] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 };
9 short b[33] = { 0, };
10 int main()
11 {
12 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
13   int i;
14   if (sizeof (short) == 2)
15     {
16       for (i = 0; i < 64; ++i)
17         {
18           (*((char(*)[])&a[1]))[i] = (*((char(*)[])&a[0]))[i+1];
19         }
20       if (memcmp (&a, &b, sizeof (a)) != 0)
21         abort ();
22     }
23 #endif
24   return 0;
25 }