glob_long_rw.c (515B)
1 /* glob: read+write a 64-bit file-scope global. The store/load are 64-bit 2 * (LDST64_ABS_LO12_NC against `gl`) so the :lo12: scaling differs from the 3 * 32-bit case. A volatile local defeats folding. `gl` is initialized nonzero 4 * to keep it in .data (a .bss global hits the SHT_NOBITS assembler gap — see 5 * glob_bss_write.skip). Exit: gl truncated to 42. */ 6 long gl = 1; 7 int test_main(void) { 8 volatile long v = 42; 9 gl = v; /* adrp/str x against gl */ 10 return (int)gl; /* adrp/ldr x against gl */ 11 }