From: Lauri Kasanen Date: Sun, 7 May 2017 17:35:49 +0000 (+0300) Subject: Add explicit postinc/dec testcase X-Git-Tag: V2.17~147^2~1 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7adcde1707eb7ab81bc1f15099ad91276f0f11eb;p=cc65 Add explicit postinc/dec testcase --- diff --git a/test/val/postincdec.c b/test/val/postincdec.c new file mode 100644 index 000000000..19a6eb2a7 --- /dev/null +++ b/test/val/postincdec.c @@ -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; +}