]> git.sur5r.net Git - cc65/commitdiff
Add test showing optimizer failure, OptUnusedLoads removes needed loads
authorLauri Kasanen <cand@gmx.com>
Wed, 10 Apr 2019 10:04:41 +0000 (13:04 +0300)
committergreg-king5 <greg.king5@verizon.net>
Sun, 21 Apr 2019 16:46:03 +0000 (12:46 -0400)
test/val/jmp-callax.c [new file with mode: 0644]

diff --git a/test/val/jmp-callax.c b/test/val/jmp-callax.c
new file mode 100644 (file)
index 0000000..224b892
--- /dev/null
@@ -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;
+}