From 5c00b8cd03cbfc516cce92229f3f4974d7549c24 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Fri, 16 Oct 2026 20:53:52 +0800 Subject: test(compiler): cover fixed CIE behavior and runtime boundaries Record independently traced outputs with pending human review. Keep standard syntax and naming conflicts as real failures. Co-Authored-By: Claude Fable 5.1 --- tests/i/integer-boundaries/case.json | 3 +++ tests/i/integer-boundaries/expected.txt | 7 +++++++ tests/i/integer-boundaries/input.txt | 2 ++ tests/i/integer-boundaries/notes.md | 7 +++++++ tests/i/integer-boundaries/program.cps | 11 +++++++++++ 5 files changed, 30 insertions(+) create mode 100644 tests/i/integer-boundaries/case.json create mode 100644 tests/i/integer-boundaries/expected.txt create mode 100644 tests/i/integer-boundaries/input.txt create mode 100644 tests/i/integer-boundaries/notes.md create mode 100644 tests/i/integer-boundaries/program.cps (limited to 'tests/i/integer-boundaries') diff --git a/tests/i/integer-boundaries/case.json b/tests/i/integer-boundaries/case.json new file mode 100644 index 0000000..1f18635 --- /dev/null +++ b/tests/i/integer-boundaries/case.json @@ -0,0 +1,3 @@ +{ + "exit_code": 0 +} diff --git a/tests/i/integer-boundaries/expected.txt b/tests/i/integer-boundaries/expected.txt new file mode 100644 index 0000000..5fd67df --- /dev/null +++ b/tests/i/integer-boundaries/expected.txt @@ -0,0 +1,7 @@ +9223372036854775807 +-9223372036854775808 +9223372036854775806 +-9223372036854775807 +-1 +TRUE:TRUE:TRUE +9223372036854775807:-9223372036854775808:0 diff --git a/tests/i/integer-boundaries/input.txt b/tests/i/integer-boundaries/input.txt new file mode 100644 index 0000000..e34e602 --- /dev/null +++ b/tests/i/integer-boundaries/input.txt @@ -0,0 +1,2 @@ +9223372036854775807 +-9223372036854775808 diff --git a/tests/i/integer-boundaries/notes.md b/tests/i/integer-boundaries/notes.md new file mode 100644 index 0000000..b89da97 --- /dev/null +++ b/tests/i/integer-boundaries/notes.md @@ -0,0 +1,7 @@ +# integer-boundaries + +Human review: pending. Expected output was independently traced by AI, not captured from cpsc. + +Basis: Project INTEGER=i64 contract; CIE pp. 7 and 15 do not specify bit width or overflow. + +Trace: Inputs are 2^63-1 and -2^63. Every operation stays in range; their sum is -1 and division by 1 preserves both values. diff --git a/tests/i/integer-boundaries/program.cps b/tests/i/integer-boundaries/program.cps new file mode 100644 index 0000000..c08b658 --- /dev/null +++ b/tests/i/integer-boundaries/program.cps @@ -0,0 +1,11 @@ +DECLARE Hi : INTEGER +DECLARE Lo : INTEGER +INPUT Hi +INPUT Lo +OUTPUT Hi +OUTPUT Lo +OUTPUT Hi - 1 +OUTPUT Lo + 1 +OUTPUT Hi + Lo +OUTPUT Lo < 0, ":", Hi > 0, ":", Lo < Hi +OUTPUT Hi DIV 1, ":", Lo DIV 1, ":", Lo MOD 1 -- cgit v1.3.1-4-g156e