modernc.org/cc@v1.0.1/testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/990208-1.c (about)

     1  /* As a quality of implementation issue, we should not prevent inlining
     2     of function explicitly marked inline just because a label therein had
     3     its address taken.  */
     4  
     5  #ifndef NO_LABEL_VALUES
     6  static void *ptr1, *ptr2;
     7  static int i = 1;
     8  
     9  static __inline__ void doit(void **pptr, int cond)
    10  {
    11    if (cond) {
    12    here:
    13      *pptr = &&here;
    14    }
    15  }
    16  
    17  __attribute__ ((noinline))
    18  static void f(int cond)
    19  {
    20    doit (&ptr1, cond);
    21  }
    22  
    23  __attribute__ ((noinline))
    24  static void g(int cond)
    25  {
    26    doit (&ptr2, cond);
    27  }
    28  
    29  __attribute__ ((noinline))
    30  static void bar(void);
    31  
    32  int main()
    33  {
    34    f (i);
    35    bar();
    36    g (i);
    37  
    38  #ifdef  __OPTIMIZE__
    39    if (ptr1 == ptr2)
    40      abort ();
    41  #endif
    42  
    43    exit (0);
    44  }
    45  
    46  void bar(void) { }
    47  
    48  #else /* NO_LABEL_VALUES */
    49  int main() { exit(0); }
    50  #endif