mirror of
https://github.com/cc65/cc65.git
synced 2025-01-30 12:33:15 +00:00
Add explicit postinc/dec testcase
This commit is contained in:
parent
a2f61c667a
commit
7adcde1707
23
test/val/postincdec.c
Normal file
23
test/val/postincdec.c
Normal file
@ -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;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user