]> git.sur5r.net Git - cc65/commitdiff
Add explicit postinc/dec testcase
authorLauri Kasanen <cand@gmx.com>
Sun, 7 May 2017 17:35:49 +0000 (20:35 +0300)
committerLauri Kasanen <cand@gmx.com>
Sun, 7 May 2017 17:35:49 +0000 (20:35 +0300)
test/val/postincdec.c [new file with mode: 0644]

diff --git a/test/val/postincdec.c b/test/val/postincdec.c
new file mode 100644 (file)
index 0000000..19a6eb2
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+  !!DESCRIPTION!! char-sized post-increment and -decrement
+  !!ORIGIN!!      cc65 regression tests
+  !!LICENCE!!     Public Domain
+  !!AUTHOR!!      Lauri Kasanen
+*/
+
+
+static unsigned char val, array[2];
+
+int main() {
+
+       val = 0;
+       array[0] = array[1] = 10;
+
+       array[val++] = 2;
+       array[val++] = 2;
+       --val;
+       array[val--] = 0;
+       array[val--] = 0;
+
+       return (array[0] == array[1] && array[0] == 0) ? 0 : 1;
+}