kit

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

ctl_shortcircuit_and.c (403B)


      1 /* Short-circuit && : the second operand must not be evaluated when the first
      2  * is false, which the compiler implements with a conditional branch past the
      3  * RHS. volatile operands keep both sub-conditions real so the skip branch
      4  * round-trips. Both true => add 42. Exit code 42. */
      5 int test_main(void) {
      6   volatile int a = 5, b = 9;
      7   int r = 0;
      8   if (a > 0 && b > 0) {
      9     r = 42;
     10   }
     11   return r;
     12 }