kit

kit
git clone https://git.ryansepassi.com/git/kit.git
Log | Files | Refs | README

gnu_label_addr_compare.c (343B)


      1 /* Label addresses are comparable values. Here the compared label `op_halt`
      2  * is also a computed-goto target, the idiomatic threaded-interpreter shape. */
      3 int test_main(void) {
      4   static void* const tab[] = {&&op_a, &&op_halt};
      5   void* next = tab[1];
      6   if (next == &&op_halt) return 7;
      7   goto* tab[0];
      8 op_a:
      9   return 1;
     10 op_halt:
     11   return 9;
     12 }