int debug_mul(void) { int product = 42; return product + 1; } int debug_add(void) { int sum = 7; return sum + 7; } int debug_array[4] = {10, 20, 30, 40}; int debug_index = 2; int debug_ptr(void) { int *p = debug_array; p += debug_index; return *p; } /* M7.2 debug-info gate driver. * * Three functions, so the linked `.debug_info` has three subprograms and the * second/third `.text` offsets are nonzero. debug_mul returns 43, * debug_add returns 14 and debug_ptr returns debug_array[2] = 30; the entry * stores them at 018A8000/018A8020/018A8040 after the stripped link is loaded * in MAME. * * debug_ptr is the bit-pointer barrier coverage: `p += debug_index` is a * runtime `getelementptr` that --bitptr rewrites, so the -O0 gate proves the * line row survives that rewrite; debug.sh also builds this TU at -O2 -g to * exercise opt/--scale/--lower-bitptr/instcombine. * * The declarations are on lines 1, 6 and 14; the first local-variable / * pointer-update lines are 2, 7, 15 and 16; debug.sh asserts those * `.debug_line` rows and the DW_AT_decl_line values. The comment is * deliberately after the code so the line numbers stay stable. */