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

     1  unsigned p;
     2  
     3  long __attribute__((noinline, noclone))
     4  test (unsigned a)
     5  {
     6    return (long)(p + a) - (long)p;
     7  }
     8  
     9  int
    10  main ()
    11  {
    12    p = (unsigned) -2;
    13    if (test (0) != 0)
    14      __builtin_abort ();
    15    if (test (1) != 1)
    16      __builtin_abort ();
    17    if (test (2) != -(long)(unsigned)-2)
    18      __builtin_abort ();
    19    p = (unsigned) -1;
    20    if (test (0) != 0)
    21      __builtin_abort ();
    22    if (test (1) != -(long)(unsigned)-1)
    23      __builtin_abort ();
    24    if (test (2) != -(long)(unsigned)-2)
    25      __builtin_abort ();
    26    return 0;
    27  }