kit

kit
git clone https://git.ryansepassi.com/git/kit.git
Log | Files | Refs | README

glob_array_long.c (436B)


      1 /* glob: read a file-scope global `long` array — the index scaling is 8 so the
      2  * load is a 64-bit scaled-register form, distinct from the 32-bit array case.
      3  * adrp/add (ADR_PREL_PG_HI21 + ADD_ABS_LO12_NC against `tabl`) plus ldr x.
      4  * A volatile index defeats folding. Exit: tabl[1] + tabl[2] = 15 + 27 = 42. */
      5 long tabl[4] = {3, 15, 27, 39};
      6 int test_main(void) {
      7   volatile int i = 1, j = 2;
      8   return (int)(tabl[i] + tabl[j]);
      9 }