boot2

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

40-array-index.c (362B)


      1 // tests/cc-parse/40-array-index.c — array element access at non-zero
      2 // index via real C (§D.5 of docs/CC-PUNCHLIST.md). a[0]+a[1]+a[2]
      3 // = 7. Distinct values 1,2,4 ensure each index is read independently
      4 // (sum 7 forms a unique bit-pattern in 3 bits).
      5 
      6 int main() {
      7     int a[3];
      8     a[0] = 1;
      9     a[1] = 2;
     10     a[2] = 4;
     11     return a[0] + a[1] + a[2];
     12 }