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

     1  /* PR rtl-optimization/54290 */
     2  /* Testcase by Eric Volk <eriksnga@gmail.com> */
     3  /* { dg-require-effective-target int32plus } */
     4  
     5  double vd[2] = {1., 0.};
     6  int vi[2] = {1234567890, 0};
     7  double *pd = vd;
     8  int *pi = vi;
     9  
    10  extern void abort(void);
    11  
    12  void init (int *n, int *dummy) __attribute__ ((noinline,noclone));
    13  
    14  void init (int *n, int *dummy)
    15  {
    16    if(0 == n) dummy[0] = 0;
    17  }
    18  
    19  int main (void)
    20  {
    21    int dummy[1532];
    22    int i = -1, n = 1, s = 0;
    23    init (&n, dummy);
    24    while (i < n) {
    25      if (i == 0) {
    26        if (pd[i] > 0) {
    27          if (pi[i] > 0) {
    28            s += pi[i];
    29          }
    30        }
    31        pd[i] = pi[i];
    32      }
    33      ++i;
    34    }
    35    if (s != 1234567890)
    36      abort ();
    37    return 0;
    38  }