OSDN Git Service

PR tree-optimization/44507
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / vect / pr44507.c
1 /* { dg-require-effective-target vect_int } */
2
3 #include <stdlib.h>
4 #include "tree-vect.h"
5
6 int seeIf256ByteArrayIsConstant(
7   unsigned char *pArray)
8 {
9   int index;
10   unsigned int curVal, orVal, andVal;
11   int bytesAreEqual = 0;
12
13   if (pArray != 0)
14     {
15       for (index = 0, orVal = 0, andVal = 0xFFFFFFFF;
16            index < 64;
17            index += (int)sizeof(unsigned int))
18         {
19           curVal = *((unsigned int *)(&pArray[index]));
20           orVal = orVal | curVal;
21           andVal = andVal & curVal;
22         }
23
24       if (!((orVal == andVal) 
25             && ((orVal >> 8) == (andVal & 0x00FFFFFF))))
26         abort ();
27     }
28      
29   return 0;
30 }
31
32
33 int main(int argc, char** argv)
34 {
35   unsigned char array1[64] = {
36     0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
37     0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
38     0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
39     0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
40     0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
41     0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
42     0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
43     0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
44   };
45
46   argv = argv;
47   argc = argc;
48
49   check_vect ();
50
51   return seeIf256ByteArrayIsConstant(&array1[0]);
52 }
53
54 /* { dg-final { cleanup-tree-dump "vect" } } */
55