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

     1  /* { dg-require-effective-target label_values } */
     2  
     3  short optab[5];
     4  char buf[10];
     5  execute (ip)
     6       register short *ip;
     7  {
     8    register void *base = &&x;
     9    char *bp = buf;
    10    static void *tab[] = {&&x, &&y, &&z};
    11    if (ip == 0)
    12      {
    13        int i;
    14        for (i = 0; i < 3; ++i)
    15  	optab[i] = (short)(tab[i] - base);
    16        return;
    17      }
    18  x:  *bp++='x';
    19      goto *(base + *ip++);
    20  y:  *bp++='y';
    21      goto *(base + *ip++);
    22  z:  *bp++='z';
    23      *bp=0;
    24      return;
    25  }
    26  
    27  short p[5];
    28  
    29  main ()
    30  {
    31    execute ((short *) 0);
    32    p[0] = optab[1];
    33    p[1] = optab[0];
    34    p[2] = optab[1];
    35    p[3] = optab[2];
    36    execute (&p);
    37    if (strcmp (buf, "xyxyz"))
    38      abort ();
    39    exit (0);
    40  }