From 7adcde1707eb7ab81bc1f15099ad91276f0f11eb Mon Sep 17 00:00:00 2001 From: Lauri Kasanen Date: Sun, 7 May 2017 20:35:49 +0300 Subject: [PATCH] Add explicit postinc/dec testcase --- test/val/postincdec.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/val/postincdec.c 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; +} -- 2.39.5