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

     1  /* This testcase failed because - 1 - buf was simplified into ~buf and when
     2     later expanding it back into - buf + -1, -1 got lost.  */
     3  /* { dg-options "-fgnu89-inline" } */
     4  
     5  extern void abort (void);
     6  extern void exit (int);
     7  
     8  static void
     9  bar (int x)
    10  {
    11    if (!x)
    12      abort ();
    13  }
    14  
    15  char buf[10];
    16  
    17  inline char *
    18  foo (char *tmp)
    19  {
    20    asm ("" : "=r" (tmp) : "0" (tmp));
    21    return tmp + 2;
    22  }
    23  
    24  int
    25  main (void)
    26  {
    27    bar ((foo (buf) - 1 - buf) == 1);
    28    exit (0);
    29  }