boot2

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

040-array-index.c (330B)


      1 // tests/cc-parse/40-array-index.c — array element access at non-zero
      2 // index via real C. a[0]+a[1]+a[2] = 7. Distinct values 1,2,4 ensure
      3 // each index is read independently (sum 7 forms a unique bit-pattern
      4 // 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 }