kit

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

glob_string.c (420B)


      1 /* glob: index a string literal. The literal lives in a .rodata string-merge
      2  * section addressed via a local .L label (adrp/add against the .Lstr symbol);
      3  * a volatile index defeats constant folding so the scaled byte load survives.
      4  * "*"=='*' has ASCII 42. Exit: 42. */
      5 int test_main(void) {
      6   const char* s = "0123456789*";
      7   volatile int i = 10; /* index of '*' */
      8   return s[i];         /* ldrb of '*' == 42 */
      9 }