kit

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

callx_chain.c (429B)


      1 /* A chain of direct calls feeding each other, so multiple CALL26 relocations
      2  * appear and the result of one call becomes an argument to the next. `noinline`
      3  * keeps each callee a distinct function. inc(20)=21, dbl(21)=42. */
      4 __attribute__((noinline)) static int inc(int x) { return x + 1; }
      5 __attribute__((noinline)) static int dbl(int x) { return x + x; }
      6 int test_main(void) {
      7   volatile int a = 20;
      8   return dbl(inc(a));
      9 }