aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/compile/pr43415.c
blob: 66afe99a06bd39a9c87ec3251a31285b8c066ac3 (plain)
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
32
33
34
35
36
37
38
/* { dg-require-stack-size "256*8+4" } */

int main()                                                                      
{                                                                               
  unsigned long long table[256];                                          
  unsigned int i;
  for (i=0; i<256; ++i) {
      unsigned long long j;
      unsigned char x=i;
      for (j=0; j<5; ++j) {
	  x += x<<1;
	  x ^= x>>1;
      }
      for (j=0; j<5; ++j) {
	  x += x<<1;
	  x ^= x>>1;
      }
      for (j=0; j<5; ++j) {
	  x += x<<1;
	  x ^= x>>1;
      }
      for (j=0; j<5; ++j) {
	  x += x<<1;
	  x ^= x>>1;
      }
      for (j=0; j<5; ++j) {
	  x += x<<1;
	  x ^= x>>1;
      }
      table[i] ^= (((unsigned long long)x)<<16);
  }
  for (i=0; i<256; ++i) {
      if ((table[i]&0xff)==i)
	return 1;
  }
  return 0;
}