boot2

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

036-struct-load.c (400B)


      1 // tests/cc-parse/36-struct-load.c — struct member load via real C.
      2 // Two int fields at distinct offsets; reading both back in distinct
      3 // positions of the result confirms the parser uses the field offset,
      4 // not 0 for both.
      5 //
      6 // s.a=1; s.b=2; return s.a + s.b*10;  =>  exit 21.
      7 
      8 int main() {
      9     struct S { int a; int b; };
     10     struct S s;
     11     s.a = 1;
     12     s.b = 2;
     13     return s.a + s.b * 10;
     14 }