kit

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

arith.c (357B)


      1 /* Branch-free integer arithmetic with memory traffic (volatile forces real
      2  * loads/stores + multiply/subtract rather than constant folding). No relocs,
      3  * no branches: exercises the plain-operand disasm/encode round-trip beyond the
      4  * ret42 leaf. Exit code 100*7 - 658 = 42. */
      5 int test_main(void) {
      6   volatile int a = 100, b = 7;
      7   return a * b - 658;
      8 }