modernc.org/ccgo/v3@v3.16.14/lib/testdata/gcc-9.1.0/gcc/testsuite/gcc.c-torture/compile/pr70199.c (about)

     1  /* { dg-require-effective-target indirect_jumps } */
     2  /* { dg-require-effective-target label_values } */
     3  
     4  static volatile int v = 0;
     5  static
     6  void benchmark(long runs) {
     7    void* labels[] = {
     8      &&l0, &&l1, &&l2
     9    };
    10    for(unsigned int mask = 0x1F; mask > 0; mask >>= 1) {
    11      unsigned lfsr = 0xACE1u;
    12      long n = 10000000;
    13      while(n > 0) {
    14        l2: v;
    15        l1: v;
    16        goto *labels[lfsr & mask];
    17        l0: n--;
    18      }
    19    }
    20  }
    21  int f(void) {
    22    benchmark(10000000);
    23  }