diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2024-03-08 20:00:24 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2024-03-08 20:00:24 -0800 |
commit | e3de6944770ff890e555f434d6d39e443d4b2542 (patch) | |
tree | a5f4d4ed1a3651f08bcada9acf0eb99c1a329627 /tests | |
parent | c005ad21d1259ea8c984e0084fd8b71cff86ca4d (diff) | |
download | txr-e3de6944770ff890e555f434d6d39e443d4b2542.tar.gz txr-e3de6944770ff890e555f434d6d39e443d4b2542.tar.bz2 txr-e3de6944770ff890e555f434d6d39e443d4b2542.zip |
tests: suppress warnings in seq.tl.
When tests/012/compile.tl compiles tests/012/seq.tl, there
are now some compiler warnings due to constant expressions
that throw. We introduce a new compiler option to suppress
them, and then use it.
* stdlib/comp-opts.tl: New file. The definitions related
to compiler options are moved here out of compile.tl,
so that optimize.tl can use them.
* stdlib/compiler.tl (compile-opts, %warning-syms%,
when-opt, *compile-opts*, opt-controlled-diag): Moved to
comp-opts.tl. New constant-throws option added to
compile-opts and %warning-syms%.
(safe-constantp): Make the constant expression throws
diagnostic conditional on the new option.
* stdlib/optimize.tl: Load comp-opts file.
(basic-blocks do-peephole-block): Make diagnostic
about throwing situation subject to constant-throws
option.
* tests/012/seq.tl: Turn off constant-throws warning
option before the ref tests that work with ranges.
Fix: one of the expressions calls refs with the
wrong number of arguments, which was unintentional.
* txr.1: Document new diagnostic option.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/012/seq.tl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/012/seq.tl b/tests/012/seq.tl index c48296bd..262c7739 100644 --- a/tests/012/seq.tl +++ b/tests/012/seq.tl @@ -826,9 +826,11 @@ [apply mapcar join (list-seq "aaa".."zzz")] (transpose (list-seq "aaa".."zzz"))) +(eval-only (set *compile-opts*.constant-throws nil)) + (mtest (ref "a".."z" 0) :error - (ref (rcons 'foo 'bar)) :error) + (ref (rcons 'foo 'bar) 0) :error) (mtest (ref 1..6 0) 1 |