boot2

Playing with the boostrap
git clone https://git.ryansepassi.com/git/boot2.git
Log | Files | Refs | README

027-void-call.c (361B)


      1 /* tests/cc-e2e/27-void-call.c — void-returning function with int* out param.
      2  * Split from 01-kitchen-sink. */
      3 
      4 void f_void(int *out, int v) { *out = v; }
      5 
      6 int test_void_call(void) {
      7     int x = 0;
      8     f_void(&x, 42);
      9     return x;                       /* 42 */
     10 }
     11 
     12 int main(int argc, char **argv) {
     13     if (test_void_call() != 42) return 1;
     14     return 0;
     15 }