boot2

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

026-enum.c (308B)


      1 /* tests/cc-e2e/26-enum.c — enum constants with explicit value.
      2  * Split from 01-kitchen-sink. */
      3 
      4 enum Color { RED, GREEN = 5, BLUE };
      5 
      6 int test_enum(void) {
      7     return RED + GREEN + BLUE;      /* 0 + 5 + 6 = 11 */
      8 }
      9 
     10 int main(int argc, char **argv) {
     11     if (test_enum() != 11) return 1;
     12     return 0;
     13 }