kit

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

6_5_2_2_05_struct_param_with_scalars.c (401B)


      1 /* Interleaved scalar/aggregate args. The 2-reg struct consumes the next
      2  * two int-arg slots and shifts the trailing scalar; this exercises the
      3  * arg-cursor accounting around a multi-part DIRECT argument. */
      4 struct S {
      5   long a, b;
      6 };
      7 int take(int pre, struct S s, int post) {
      8   return pre + (int)s.a + (int)s.b + post;
      9 }
     10 int test_main(void) {
     11   struct S s = {10L, 11L};
     12   return take(10, s, 11);
     13 }