kit

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

cond.c (456B)


      1 /* A conditional (ternary) compiled to an intra-function conditional branch.
      2  * `noinline` forces a real call (CALL26) plus the in-body branch, so this
      3  * exercises both reloc symbolization (the call, checked by L1) and branch-label
      4  * synthesis (the conditional, covered by L0/L2; L1 auto-skipped pending P2).
      5  * Exit code: |-42| = 42. */
      6 __attribute__((noinline)) static int sel(int x) { return x < 0 ? -x : x; }
      7 int test_main(void) { return sel(-42); }