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

     1  #include <limits.h>
     2  
     3  #if INT_MAX <= 32767
     4  int main () { exit (0); }
     5  #else
     6  void get_addrs (const char**x, int *y)
     7  {
     8    x[0] = "a1111" + (y[0] - 0x10000) * 2;
     9    x[1] = "a1112" + (y[1] - 0x20000) * 2;
    10    x[2] = "a1113" + (y[2] - 0x30000) * 2;
    11    x[3] = "a1114" + (y[3] - 0x40000) * 2;
    12    x[4] = "a1115" + (y[4] - 0x50000) * 2;
    13    x[5] = "a1116" + (y[5] - 0x60000) * 2;
    14    x[6] = "a1117" + (y[6] - 0x70000) * 2;
    15    x[7] = "a1118" + (y[7] - 0x80000) * 2;
    16  }
    17  
    18  int main ()
    19  {
    20    const char *x[8];
    21    int y[8];
    22    int i;
    23  
    24    for (i = 0; i < 8; i++)
    25      y[i] = 0x10000 * (i + 1);
    26    get_addrs (x, y);
    27    for (i = 0; i < 8; i++)
    28      if (*x[i] != 'a')
    29        abort ();
    30    exit (0);
    31  }
    32  #endif