modernc.org/cc@v1.0.1/testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/comp-goto-2.c (about)

     1  /* A slight variation of 920501-7.c.  */
     2  
     3  #ifdef STACK_SIZE
     4  #define DEPTH ((STACK_SIZE) / 512 + 1)
     5  #else
     6  #define DEPTH 1000
     7  #endif
     8  
     9  #if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES)
    10  x(a)
    11  {
    12    __label__ xlab;
    13    void y(a)
    14      {
    15        void *x = &&llab;
    16        if (a==-1)
    17  	goto *x;
    18        if (a==0)
    19  	goto xlab;
    20      llab:
    21        y (a-1);
    22      }
    23    y (a);
    24   xlab:;
    25    return a;
    26  }
    27  #endif
    28  
    29  main ()
    30  {
    31  #if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES)
    32    if (x (DEPTH) != DEPTH)
    33      abort ();
    34  #endif
    35    exit (0);
    36  }