* src/Main.hs (evalM): Here.
In some cases, plaining removes nested seqs in the original
program. If plaining happens first, checkLow may accept a
program as valid LIR when in fact the original program
contained nested seqs.
* tests/nestedseq.hir,
* tests/nestedseq.test:
New test.
* tests/Makefile.am (TESTS): Add nestedseq.test.
(EXTRA_DIST): Add nestedseq.hir.
Signed-off-by: Roland Levillain <roland(a)lrde.epita.fr>
---
src/Main.hs | 4 ++--
tests/Makefile.am | 10 +++++++---
tests/nestedseq.hir | 8 ++++++++
tests/{overflow.test => nestedseq.test} | 9 +--------
4 files changed, 18 insertions(+), 13 deletions(-)
create mode 100644 tests/nestedseq.hir
copy tests/{overflow.test => nestedseq.test} (80%)
diff --git a/src/Main.hs b/src/Main.hs
index 652c2c3..46b84d4 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -116,14 +116,14 @@ evalM fm stms =
setHandle setProfileHandle fm "profile"
setHandle setDisplayHandle fm "display"
setHandle setTraceHandle fm "trace"
+ trace ["checkingLow"]
+ checkLowM stms
trace ["plaining"]
stms <- plainStms stms
trace ["unparsing"]
unparseM stms
trace ["checking"]
checkHighM stms
- trace ["checkingLow"]
- checkLowM stms
preloadStms 0 stms
rstore "i0" 0
trace ["evaling"]
diff --git a/tests/Makefile.am b/tests/Makefile.am
index c7a59a0..6bbce72 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -4,10 +4,14 @@
XFAIL_TESTS =
-TESTS = \
-cmp.test overflow.test trace.test
+TESTS = \
+ cmp.test nestedseq.test overflow.test trace.test
-EXTRA_DIST = cmp.lir cmp.out fact.lir fact.out overflow.lir overflow.out \
+EXTRA_DIST = \
+ cmp.lir cmp.out \
+ fact.lir fact.out \
+ nestedseq.hir \
+ overflow.lir overflow.out \
$(TESTS)
# Each test case depends on defs.
diff --git a/tests/nestedseq.hir b/tests/nestedseq.hir
new file mode 100644
index 0000000..6d5a5fb
--- /dev/null
+++ b/tests/nestedseq.hir
@@ -0,0 +1,8 @@
+label main
+seq
+ seq
+ sxp
+ const 0
+ seq end
+seq end
+label end
diff --git a/tests/overflow.test b/tests/nestedseq.test
similarity index 80%
copy from tests/overflow.test
copy to tests/nestedseq.test
index 9904ac7..ba105b8 100755
--- a/tests/overflow.test
+++ b/tests/nestedseq.test
@@ -22,11 +22,4 @@
set -e
-HAVM_pass --trace $srcdir/overflow.lir
-cmp stdout $srcdir/overflow.out
-test -s stderr
-
-HAVM_pass --trace=3 $srcdir/overflow.lir 3>stdtrc
-cmp stdout $srcdir/overflow.out
-test ! -s stderr
-test -s stdtrc
+HAVM_run 129 --low $srcdir/nestedseq.hir
--
1.7.10.4