OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20030916-1.c] - Blame information for rev 297

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 297 jeremybenn
/* "i" overflows in f().  Check that x[i] is not treated as a giv.  */
2
#include <limits.h>
3
 
4
#if CHAR_BIT == 8
5
 
6
void f (unsigned int *x)
7
{
8
  unsigned char i;
9
  int j;
10
 
11
  i = 0x10;
12
  for (j = 0; j < 0x10; j++)
13
    {
14
      i += 0xe8;
15
      x[i] = 0;
16
      i -= 0xe7;
17
    }
18
}
19
 
20
int main ()
21
{
22
  unsigned int x[256];
23
  int i;
24
 
25
  for (i = 0; i < 256; i++)
26
    x[i] = 1;
27
  f (x);
28
  for (i = 0; i < 256; i++)
29
    if (x[i] != (i >= 0x08 && i < 0xf8))
30
      abort ();
31
  exit (0);
32
}
33
#else
34
int main () { exit (0); }
35
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.