From f29220be1b37f139b64f9844b74014bda03e8b3c Mon Sep 17 00:00:00 2001 From: Lauri Kasanen Date: Wed, 10 Apr 2019 13:04:41 +0300 Subject: [PATCH] Add test showing optimizer failure, OptUnusedLoads removes needed loads --- test/val/jmp-callax.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/val/jmp-callax.c 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; +} -- 2.39.5