diff options
Diffstat (limited to 'test/external/c-testsuite/tests/single-exec/00031.c')
| -rw-r--r-- | test/external/c-testsuite/tests/single-exec/00031.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/test/external/c-testsuite/tests/single-exec/00031.c b/test/external/c-testsuite/tests/single-exec/00031.c new file mode 100644 index 0000000..09b43ce --- /dev/null +++ b/test/external/c-testsuite/tests/single-exec/00031.c @@ -0,0 +1,48 @@ +int +zero() +{ + return 0; +} + +int +one() +{ + return 1; +} + +int +main() +{ + int x; + int y; + + x = zero(); + y = ++x; + if (x != 1) + return 1; + if (y != 1) + return 1; + + x = one(); + y = --x; + if (x != 0) + return 1; + if (y != 0) + return 1; + + x = zero(); + y = x++; + if (x != 1) + return 1; + if (y != 0) + return 1; + + x = one(); + y = x--; + if (x != 0) + return 1; + if (y != 1) + return 1; + + return 0; +} |