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

     1  struct barstruct { char const* some_string; } x;
     2  extern void abort (void);
     3  void __attribute__((noinline))
     4  foo(void)
     5  {
     6    if (!x.some_string)
     7      abort ();
     8  }
     9  void baz(int b)
    10  {
    11    struct barstruct bar;
    12    struct barstruct* barptr;
    13    if (b)
    14      barptr = &bar;
    15    else
    16      {
    17        barptr = &x + 1;
    18        barptr = barptr - 1;
    19      }
    20    barptr->some_string = "Everything OK";
    21    foo();
    22    barptr->some_string = "Everything OK";
    23  }
    24  int main()
    25  {
    26    x.some_string = (void *)0;
    27    baz(0);
    28    if (!x.some_string)
    29      abort ();
    30    return 0;
    31  }
    32