kit

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

call.c (564B)


      1 /* A real intra-module call. `noinline` keeps `helper` a distinct function so
      2  * codegen emits a CALL26 relocation against it (rather than inlining), which
      3  * the symbolizer must render as `bl helper`. Both function bodies are
      4  * branch-free, so the only round-trip surface added here is CALL26. Same-file
      5  * calls relocate against the function symbol on both sides (codegen and `as`),
      6  * so the .text reloc tables match. Exit code helper(21) = 42. */
      7 __attribute__((noinline)) static int helper(int x) { return x + x; }
      8 int test_main(void) { return helper(21); }