From: Lauri Kasanen Date: Wed, 10 Apr 2019 10:04:41 +0000 (+0300) Subject: Add test showing optimizer failure, OptUnusedLoads removes needed loads X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f29220be1b37f139b64f9844b74014bda03e8b3c;p=cc65 Add test showing optimizer failure, OptUnusedLoads removes needed loads --- diff --git a/test/val/jmp-callax.c b/test/val/jmp-callax.c new file mode 100644 index 000000000..224b89251 --- /dev/null +++ b/test/val/jmp-callax.c @@ -0,0 +1,21 @@ +static unsigned char val; + +static void foo(void) { + val = 5; +} + +static void wrap() { + + asm("lda #<%v", foo); + asm("ldx #>%v", foo); + asm("jmp callax"); + +} + +int main() { + + val = 0; + wrap(); + + return val == 5 ? 0 : 1; +}