Commit 9ef1b9d8 authored by POTTIER Francois's avatar POTTIER Francois

Merge branch 'coverage' into merr

parents 6ad597c0 0050c841
......@@ -6,3 +6,5 @@
*.conflicts
failures
warnings
*.log
lr.csv
.PHONY: clean test expected
.PHONY: clean test expected list
# Note that there is potential confusion between src/_stage1/menhir
# and src/_stage2/menhir. Here, we use the latter (built by "make
......@@ -97,8 +97,53 @@ expected:
@ CREATE_EXPECTED=1 $(MAKE) -s test
@ echo "Expected output re-generated."
clean:
clean::
rm -f *~
rm -f *.ml *.mli *.conflicts *.automaton
rm -f *.out failures warnings
# ------------------------------------------------------------------------------
# Testing LRijkstra, that is, menhir --list-errors.
ifeq ($(shell hostname),teraram)
TIMEOUT := 1200
PARALLEL := -j30
else
TIMEOUT := 2
PARALLEL := -j4
endif
SINGLE = $(shell ls *.mly | egrep -v '.*-([1-9]).mly')
%.log: %.mly
@ echo "Now dealing with: $<" | tee -a $@
@ if (timeout $(TIMEOUT) $(MENHIR) --list-errors -la 2 --lalr $<) >>$@ 2>&1 ; then \
echo "$<: success." | tee -a $@ ; \
else \
echo "$<: TIMEOUT (or failure)." | tee -a $@ ; \
fi
list:
# Compile Menhir.
# make -C $(SRC) clean
make -C $(SRC) bootstrap
# Remove any leftover output files.
rm -f *.log lr.csv
# Print the header of lr.csv. (This should be kept in sync with LRijkstra.ml.)
echo "grammar,terminals,nonterminals,size,states,trie,facts,edges,time,heap" > lr.csv
# Try every grammar. (Only the single-file grammars, that is.)
# This can proceed in parallel, for a reasonable number of processes.
# Each process appends one line of data to lr.csv when it finishes.
# Hopefully the final content of lr.csv will be a reasonable interleaving
# of these lines.
@ time $(MAKE) $(PARALLEL) $(patsubst %.mly,%.log,$(SINGLE))
# Finished.
@ echo "Number of grammars that could not be handled in $(TIMEOUT) seconds:"
@ grep TIMEOUT *.log | wc -l
@ echo "Number of grammars that were successfully handled:"
@ tail -n +2 lr.csv | wc -l
clean::
rm -f *.log
# rm -f lr.csv
Note: the nonterminal symbol option (from compcert_simplified.mly) is renamed compcert_simplified_option.
Warning: you are using the standard library and/or the %inline keyword. We
recommend switching on --infer in order to avoid obscure type error messages.
This diff is collapsed.
This diff is collapsed.
#!/bin/bash
# This script runs menhir --list-errors on every grammar in bench/good,
# aborting if it takes too long.
TIMEOUT=120
export OCAMLRUNPARAM=b
SRC=../../src
MENHIR=../../src/_stage2/menhir.native
# Compile Menhir.
make -C $SRC clean || exit 1
make -C $SRC bootstrap || exit 1
# Remove any leftover output files.
rm -f log lr.csv
# Print the header of lr.csv. (This should be kept in sync with LRijkstra.ml.)
echo "grammar,terminals,nonterminals,size,states,trie,facts,edges,time,heap" > lr.csv
# Try every grammar. (Only the single-file grammars, that is.)
for f in `ls *.mly | egrep -v '.*-([1-9]).mly'` ; do
echo "Now dealing with: $f" | tee -a log
(timeout $TIMEOUT $MENHIR -lg 1 -la 2 --list-errors --lalr $f) >>log 2>&1
echo "Done dealing with: $f" >> log
done
echo "Number of grammars that could not be handled in $TIMEOUT seconds:"
grep aborting log | wc -l
File "framac-cparser.mly", line 389, characters 54-60:
Warning: the token ADDROF is unused.
File "framac-cparser.mly", line 357, characters 36-50:
Warning: the token ATTRIBUTE_USED is unused.
File "framac-cparser.mly", line 358, characters 7-22:
Warning: the token BUILTIN_VA_LIST is unused.
File "framac-cparser.mly", line 389, characters 42-46:
Warning: the token CAST is unused.
File "framac-cparser.mly", line 319, characters 59-64:
Warning: the token INT32 is unused.
File "framac-cparser.mly", line 389, characters 0-6:
Warning: the precedence level assigned to ADDROF is never useful.
File "framac-cparser.mly", line 389, characters 0-6:
Warning: the precedence level assigned to ALIGNOF is never useful.
File "framac-cparser.mly", line 383, characters 0-5:
Warning: the precedence level assigned to AND is never useful.
File "framac-cparser.mly", line 380, characters 0-5:
Warning: the precedence level assigned to AND_AND is never useful.
File "framac-cparser.mly", line 376, characters 0-6:
Warning: the precedence level assigned to AND_EQ is never useful.
File "framac-cparser.mly", line 391, characters 0-5:
Warning: the precedence level assigned to ARROW is never useful.
File "framac-cparser.mly", line 389, characters 0-6:
Warning: the precedence level assigned to CAST is never useful.
File "framac-cparser.mly", line 382, characters 0-5:
Warning: the precedence level assigned to CIRC is never useful.
File "framac-cparser.mly", line 376, characters 0-6:
Warning: the precedence level assigned to CIRC_EQ is never useful.
File "framac-cparser.mly", line 375, characters 0-5:
Warning: the precedence level assigned to COMMA is never useful.
File "framac-cparser.mly", line 388, characters 0-5:
Warning: the precedence level assigned to CONST is never useful.
File "framac-cparser.mly", line 391, characters 0-5:
Warning: the precedence level assigned to DOT is never useful.
File "framac-cparser.mly", line 376, characters 0-6:
Warning: the precedence level assigned to EQ is never useful.
File "framac-cparser.mly", line 384, characters 0-5:
Warning: the precedence level assigned to EQ_EQ is never useful.
File "framac-cparser.mly", line 389, characters 0-6:
Warning: the precedence level assigned to EXCLAM is never useful.
File "framac-cparser.mly", line 384, characters 0-5:
Warning: the precedence level assigned to EXCLAM_EQ is never useful.
File "framac-cparser.mly", line 385, characters 0-5:
Warning: the precedence level assigned to INF is never useful.
File "framac-cparser.mly", line 385, characters 0-5:
Warning: the precedence level assigned to INF_EQ is never useful.
File "framac-cparser.mly", line 386, characters 0-5:
Warning: the precedence level assigned to INF_INF is never useful.
File "framac-cparser.mly", line 376, characters 0-6:
Warning: the precedence level assigned to INF_INF_EQ is never useful.
File "framac-cparser.mly", line 391, characters 0-5:
Warning: the precedence level assigned to LBRACE is never useful.
File "framac-cparser.mly", line 390, characters 0-5:
Warning: the precedence level assigned to LBRACKET is never useful.
File "framac-cparser.mly", line 387, characters 0-5:
Warning: the precedence level assigned to MINUS is never useful.
File "framac-cparser.mly", line 376, characters 0-6:
Warning: the precedence level assigned to MINUS_EQ is never useful.
File "framac-cparser.mly", line 389, characters 0-6:
Warning: the precedence level assigned to MINUS_MINUS is never useful.
File "framac-cparser.mly", line 388, characters 0-5:
Warning: the precedence level assigned to PERCENT is never useful.
File "framac-cparser.mly", line 376, characters 0-6:
Warning: the precedence level assigned to PERCENT_EQ is never useful.
File "framac-cparser.mly", line 381, characters 0-5:
Warning: the precedence level assigned to PIPE is never useful.
File "framac-cparser.mly", line 376, characters 0-6:
Warning: the precedence level assigned to PIPE_EQ is never useful.
File "framac-cparser.mly", line 379, characters 0-5:
Warning: the precedence level assigned to PIPE_PIPE is never useful.
File "framac-cparser.mly", line 387, characters 0-5:
Warning: the precedence level assigned to PLUS is never useful.
File "framac-cparser.mly", line 376, characters 0-6:
Warning: the precedence level assigned to PLUS_EQ is never useful.
File "framac-cparser.mly", line 389, characters 0-6:
Warning: the precedence level assigned to PLUS_PLUS is never useful.
File "framac-cparser.mly", line 378, characters 0-6:
Warning: the precedence level assigned to QUEST is never useful.
File "framac-cparser.mly", line 388, characters 0-5:
Warning: the precedence level assigned to RESTRICT is never useful.
File "framac-cparser.mly", line 389, characters 0-6:
Warning: the precedence level assigned to SIZEOF is never useful.
File "framac-cparser.mly", line 388, characters 0-5:
Warning: the precedence level assigned to SLASH is never useful.
File "framac-cparser.mly", line 376, characters 0-6:
Warning: the precedence level assigned to SLASH_EQ is never useful.
File "framac-cparser.mly", line 388, characters 0-5:
Warning: the precedence level assigned to STAR is never useful.
File "framac-cparser.mly", line 376, characters 0-6:
Warning: the precedence level assigned to STAR_EQ is never useful.
File "framac-cparser.mly", line 385, characters 0-5:
Warning: the precedence level assigned to SUP is never useful.
File "framac-cparser.mly", line 385, characters 0-5:
Warning: the precedence level assigned to SUP_EQ is never useful.
File "framac-cparser.mly", line 386, characters 0-5:
Warning: the precedence level assigned to SUP_SUP is never useful.
File "framac-cparser.mly", line 376, characters 0-6:
Warning: the precedence level assigned to SUP_SUP_EQ is never useful.
File "framac-cparser.mly", line 389, characters 0-6:
Warning: the precedence level assigned to TILDE is never useful.
File "framac-cparser.mly", line 388, characters 0-5:
Warning: the precedence level assigned to VOLATILE is never useful.
File "framac-cparser.mly", line 464, characters 56-61:
Warning: this %prec declaration is never useful.
Warning: one state has shift/reduce conflicts.
Warning: one shift/reduce conflict was arbitrarily resolved.
File "framac-cparser.mly", line 1304, characters 2-28:
Warning: production direct_old_proto_decl -> direct_decl LPAREN RPAREN is never reduced.
File "framac-cparser.mly", line 1443, characters 2-26:
Warning: production function_def_start -> IDENT LPAREN RPAREN is never reduced.
File "framac-cparser.mly", line 509, characters 2-37:
Warning: production global -> IDENT LPAREN RPAREN SEMICOLON is never reduced.
File "framac-cparser.mly", line 1548, characters 4-24:
Warning: production var_attr -> IDENT COLON CST_INT is never reduced.
File "framac-cparser.mly", line 1549, characters 4-29:
Warning: production var_attr -> NAMED_TYPE COLON CST_INT is never reduced.
Warning: in total, 5 productions are never reduced.
This diff is collapsed.
This diff is collapsed.
/**************************************************************************/
/* */
/* This file is part of Frama-C. */
/* */
/* Copyright (C) 2007-2015 */
/* CEA (Commissariat à l'énergie atomique et aux énergies */
/* alternatives) */
/* */
/* you can redistribute it and/or modify it under the terms of the GNU */
/* Lesser General Public License as published by the Free Software */
/* Foundation, version 2.1. */
/* */
/* It 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 Lesser General Public License for more details. */
/* */
/* See the GNU Lesser General Public License version 2.1 */
/* for more details (enclosed in the file licenses/LGPLv2.1). */
/* */
/**************************************************************************/
%{
%}
%token <string> WORD
%token LPAR
%token RPAR
%token COMMA
%token EOF
%start main
%type <string> main
%%
main:
type_string EOF { $1 }
word: WORD { $1 }
type_string: word { $1 }
| type_string word { "'a "^$2 }
| LPAR type_string COMMA type_string RPAR word { "('a,'b) "^$6 }
| LPAR type_string COMMA type_string COMMA type_string RPAR word { "('a,'b,'c) "^$8 }
| LPAR type_string COMMA type_string COMMA type_string COMMA type_string RPAR word { "('a,'b,'c,'d) "^$10 }
%{
%}
%start main
%token <string> WORD
%token RPAR
%token LPAR
%token EOF
%token COMMA
%type <string> main
%%
main:
| _1 = type_string _2 = EOF
{ ( _1 )}
word:
| _1 = WORD
{ ( _1 )}
type_string:
| _1 = word
{ ( _1 )}
| _1 = type_string _2 = word
{ ( "'a "^_2 )}
| _1 = LPAR _2 = type_string _3 = COMMA _4 = type_string _5 = RPAR _6 = word
{ ( "('a,'b) "^_6 )}
| _1 = LPAR _2 = type_string _3 = COMMA _4 = type_string _5 = COMMA _6 = type_string _7 = RPAR _8 = word
{ ( "('a,'b,'c) "^_8 )}
| _1 = LPAR _2 = type_string _3 = COMMA _4 = type_string _5 = COMMA _6 = type_string _7 = COMMA _8 = type_string _9 = RPAR _10 = word
{ ( "('a,'b,'c,'d) "^_10 )}
%%
File "ltlparser.mly", line 64, characters 0-6:
Warning: the precedence level assigned to LTL_DIV is never useful.
File "ltlparser.mly", line 58, characters 0-6:
Warning: the precedence level assigned to LTL_EQ is never useful.
File "ltlparser.mly", line 58, characters 0-6:
Warning: the precedence level assigned to LTL_GE is never useful.
File "ltlparser.mly", line 58, characters 0-6:
Warning: the precedence level assigned to LTL_GT is never useful.
File "ltlparser.mly", line 58, characters 0-6:
Warning: the precedence level assigned to LTL_LE is never useful.
File "ltlparser.mly", line 58, characters 0-6:
Warning: the precedence level assigned to LTL_LT is never useful.
File "ltlparser.mly", line 64, characters 0-6:
Warning: the precedence level assigned to LTL_MINUS is never useful.
File "ltlparser.mly", line 64, characters 0-6:
Warning: the precedence level assigned to LTL_MODULO is never useful.
File "ltlparser.mly", line 58, characters 0-6:
Warning: the precedence level assigned to LTL_NEQ is never useful.
File "ltlparser.mly", line 64, characters 0-6:
Warning: the precedence level assigned to LTL_PLUS is never useful.
File "ltlparser.mly", line 64, characters 0-6:
Warning: the precedence level assigned to LTL_STAR is never useful.
Warning: 5 states have shift/reduce conflicts.
Warning: 7 shift/reduce conflicts were arbitrarily resolved.
This diff is collapsed.
This diff is collapsed.
File "promelaparser.mly", line 51, characters 0-9:
Warning: the precedence level assigned to PROMELA_FALSE is never useful.
File "promelaparser.mly", line 51, characters 0-9:
Warning: the precedence level assigned to PROMELA_TRUE is never useful.
This diff is collapsed.
This diff is collapsed.
File "promelaparser_withexps.mly", line 66, characters 0-6:
Warning: the precedence level assigned to PROMELA_DIV is never useful.
File "promelaparser_withexps.mly", line 61, characters 0-6:
Warning: the precedence level assigned to PROMELA_EQ is never useful.
File "promelaparser_withexps.mly", line 50, characters 0-9:
Warning: the precedence level assigned to PROMELA_FALSE is never useful.
File "promelaparser_withexps.mly", line 61, characters 0-6:
Warning: the precedence level assigned to PROMELA_GE is never useful.
File "promelaparser_withexps.mly", line 61, characters 0-6:
Warning: the precedence level assigned to PROMELA_GT is never useful.
File "promelaparser_withexps.mly", line 61, characters 0-6:
Warning: the precedence level assigned to PROMELA_LE is never useful.
File "promelaparser_withexps.mly", line 61, characters 0-6:
Warning: the precedence level assigned to PROMELA_LT is never useful.
File "promelaparser_withexps.mly", line 66, characters 0-6:
Warning: the precedence level assigned to PROMELA_MINUS is never useful.
File "promelaparser_withexps.mly", line 66, characters 0-6:
Warning: the precedence level assigned to PROMELA_MODULO is never useful.
File "promelaparser_withexps.mly", line 61, characters 0-6:
Warning: the precedence level assigned to PROMELA_NEQ is never useful.
File "promelaparser_withexps.mly", line 66, characters 0-6:
Warning: the precedence level assigned to PROMELA_PLUS is never useful.
File "promelaparser_withexps.mly", line 66, characters 0-6:
Warning: the precedence level assigned to PROMELA_STAR is never useful.
File "promelaparser_withexps.mly", line 50, characters 0-9:
Warning: the precedence level assigned to PROMELA_TRUE is never useful.
Warning: 4 states have shift/reduce conflicts.
Warning: 4 shift/reduce conflicts were arbitrarily resolved.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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