modernc.org/ccgo/v3@v3.16.14/lib/testdata/gcc-9.1.0/gcc/testsuite/gcc.c-torture/execute/20030916-1.c (about)

     1  /* "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