kit

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

callx_retval.c (426B)


      1 /* A function returning a value that the caller then consumes in further
      2  * arithmetic (not a tail-return of the call result). Forces the call result in
      3  * x0/w0 to be moved/spilled and reused. `noinline` makes it a real call.
      4  * mul(6,7) = 42, used directly. */
      5 __attribute__((noinline)) static int mul(int a, int b) { return a * b; }
      6 int test_main(void) {
      7   volatile int x = 6, y = 7;
      8   int r = mul(x, y);
      9   return r - 0;
     10 }