boot2

Playing with the boostrap
git clone https://git.ryansepassi.com/git/boot2.git
Log | Files | Refs | README

021-goto.c (318B)


      1 /* tests/cc-e2e/21-goto.c — backward goto into a labelled stmt.
      2  * Split from 01-kitchen-sink. */
      3 
      4 int test_goto(void) {
      5     int n = 0;
      6 loop:
      7     n = n + 1;
      8     if (n < 5) goto loop;
      9     return n;                       /* 5 */
     10 }
     11 
     12 int main(int argc, char **argv) {
     13     if (test_goto() != 5) return 1;
     14     return 0;
     15 }