aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-08-02 14:19:07 +0900
committernsfisis <nsfisis@gmail.com>2025-08-15 10:06:21 +0900
commitbb484d2310acf5c31792cfc16b887f4746a64816 (patch)
treef3c4f588210edb3f19a114f8b9606896c7b69f1d /tests
parent000e9d54435081bd40f877b319658e44dc45c7e0 (diff)
downloadducc-bb484d2310acf5c31792cfc16b887f4746a64816.tar.gz
ducc-bb484d2310acf5c31792cfc16b887f4746a64816.tar.zst
ducc-bb484d2310acf5c31792cfc16b887f4746a64816.zip
feat: implement postfix increment/decrement operator
Diffstat (limited to 'tests')
-rw-r--r--tests/080.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/080.sh b/tests/080.sh
new file mode 100644
index 0000000..ed649da
--- /dev/null
+++ b/tests/080.sh
@@ -0,0 +1,30 @@
+set -e
+
+cat <<'EOF' > expected
+44
+44
+46
+46
+44
+42
+42
+EOF
+
+bash ../../test_diff.sh <<'EOF'
+int printf();
+
+int main() {
+ int a = 42;
+ ++a;
+ a++;
+ printf("%d\n", a);
+ printf("%d\n", a++);
+ printf("%d\n", ++a);
+ printf("%d\n", a);
+ --a;
+ a--;
+ printf("%d\n", a--);
+ printf("%d\n", --a);
+ printf("%d\n", a);
+}
+EOF