boot2

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

051-init-array-list.c (318B)


      1 // tests/cc-parse/51-init-array-list.c — global int array initialised
      2 // from element list. §E.3.
      3 //
      4 // Array indexing (a[i]) is owned by Agent 2 (§D). Read each element
      5 // via a manually-decayed pointer and pointer arithmetic.
      6 int a[3] = {1, 2, 4};
      7 int *p = a;
      8 int main(void) { return *p + *(p + 1) + *(p + 2); }