diff options
| author | 2026-10-14 09:43:55 +0000 | |
|---|---|---|
| committer | 2026-10-14 09:43:55 +0000 | |
| commit | 52972fe525abde6e107d7240be91a8985abf0683 (patch) | |
| tree | 571fcb7b8f424eb131421b63bc91cae9ceccf051 /tests/parity.known | |
| parent | todo: record the reverted unchecked trial and what it showed (diff) | |
parity: compare what zc0 and the self-hosted compiler print
src/tools/parity.sh compiles each program of tests/programs, examples and
examples/learn with zc0 (runtime, program, mkgenome, a microcore with the image
embedded, kept under build/parity/) and runs it beside build/bin/zy < prog.zc,
then compares stdout. what zc0 rejects is skipped and counted. tests/parity.known
lists the differences that are by design (zc0 has no ownership analysis or
memdebug checks). make parity runs it. tests/programs/parity_ops.zc pins operator
precedence and associativity across every binary operator, unary operators,
assignment and short-circuit order; its output matches a c compiler's.
Diffstat (limited to 'tests/parity.known')
| -rw-r--r-- | tests/parity.known | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/parity.known b/tests/parity.known new file mode 100644 index 0000000..0a73eb3 --- /dev/null +++ b/tests/parity.known @@ -0,0 +1,15 @@ +# programs where zc0 and the self-hosted compiler print different things on purpose. +# src/tools/parity.sh still runs them and shows the difference as known, and it does +# not fail the run; when one starts to agree it says so, and its line can go. +# one program per line: the path, then # and the reason. +# +# zc0 reads types and ownership tags and throws them away. it has no ownership +# analysis and no memdebug checks, so it neither warns about, traps on nor frees what +# the self-hosted compiler does. +tests/programs/doublefree.zc # memdebug on: only the self-hosted compiler emits the double free check +tests/programs/scrub.zc # ownership: the analyzer warns about the use after free, zc0 runs it +tests/programs/uaf.zc # ownership: the analyzer warns about the use after free; zc0 prints nothing +tests/programs/uaf_in.zc # memdebug on: only the self-hosted compiler emits the use after free check +examples/lists.zc # ownership: the block's owner frees at its end, zc0 never frees +# the next program reads a local it never sets when stdin is empty, so it prints stack garbage +tests/programs/bench_strings.zc # reads the repeat count from stdin; with none, acc is uninitialized |
