Commit cbc954b1 authored by Pablo de Oliveira's avatar Pablo de Oliveira Committed by Roland Levillain

checkLow should occur before plaining.

	* 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's avatarRoland Levillain <roland@lrde.epita.fr>
parent d3b5c93b
......@@ -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"]
......
......@@ -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.
......
label main
seq
seq
sxp
const 0
seq end
seq end
label end
#! /bin/sh
# Copyright (C) 2014 EPITA Research and Development Laboratory (LRDE)
#
# This file is part of HAVM.
#
# HAVM is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# HAVM is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Texinfo; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
. ./defs || exit 1
set -e
HAVM_run 129 --low $srcdir/nestedseq.hir
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment