65816-llvm-mos/demos/probeDie.c
Scott Duensing da095402ec Updated
2026-06-02 23:17:57 -05:00

22 lines
447 B
C

// Phase 3.2 slice 1 DIE-walker probe.
// Three locals on the stack, a couple of params, plus a global.
// We want to see DW_TAG_subprogram, DW_TAG_variable, DW_TAG_formal_parameter
// in the .debug_info.
int gCounter = 0;
int add3(int a, int b, int c) {
int sum = a + b;
int tot = sum + c;
return tot;
}
int main(void) {
int x = 0xABCD;
int y = 0x1234;
int z = add3(x, y, gCounter);
gCounter = z;
return z;
}